n2p2 - A neural network potential package
nnp::SymGrpBaseExpAng Class Referenceabstract

#include <SymGrpBaseExpAng.h>

Inheritance diagram for nnp::SymGrpBaseExpAng:
Collaboration diagram for nnp::SymGrpBaseExpAng:

Public Member Functions

virtual void setScalingFactors ()
 Fill scalingFactors with values from member symmetry functions. More...
 
virtual std::vector< std::string > parameterLines () const
 Give symmetry function group parameters on multiple lines. More...
 
- Public Member Functions inherited from nnp::SymGrpBaseCutoff
double getRc () const
 Get private rc member variable. More...
 
- Public Member Functions inherited from nnp::SymGrp
virtual ~SymGrp ()
 Virtual destructor. More...
 
virtual bool operator== (SymGrp const &rhs) const =0
 Overload == operator. More...
 
virtual bool operator< (SymGrp const &rhs) const =0
 Overload < operator. More...
 
bool operator!= (SymGrp const &rhs) const
 Overload != operator. More...
 
bool operator> (SymGrp const &rhs) const
 Overload > operator. More...
 
bool operator<= (SymGrp const &rhs) const
 Overload <= operator. More...
 
bool operator>= (SymGrp const &rhs) const
 Overload >= operator. More...
 
virtual bool addMember (SymFnc const *const symmetryFunction)=0
 Potentially add a member to group. More...
 
virtual void sortMembers ()=0
 Sort member symmetry functions. More...
 
virtual void setScalingFactors ()=0
 Fill scalingFactors with values from member symmetry functions. More...
 
virtual void calculate (Atom &atom, bool const derivatives) const =0
 Calculate all symmetry functions of this group for one atom. More...
 
virtual std::vector< std::string > parameterLines () const =0
 Give symmetry function group parameters on multiple lines. More...
 
void setIndex (std::size_t index)
 Set private index member variable. More...
 
std::size_t getIndex () const
 Get private index member variable. More...
 
std::size_t getType () const
 Get private type member variable. More...
 
std::size_t getEc () const
 Get private ec member variable. More...
 

Protected Member Functions

 SymGrpBaseExpAng (std::size_t type, ElementMap const &elementMap)
 Constructor, sets type. More...
 
virtual std::vector< SymFncBaseExpAng const * > getMembers () const =0
 Get symmetry function members. More...
 
- Protected Member Functions inherited from nnp::SymGrpBaseCutoff
 SymGrpBaseCutoff (std::size_t type, ElementMap const &elementMap)
 Constructor, sets type. More...
 
- Protected Member Functions inherited from nnp::SymGrp
 SymGrp (std::size_t type, ElementMap const &elementMap)
 Constructor, sets type. More...
 
std::string getPrintFormatCommon () const
 Get common parameter line format string. More...
 
std::string getPrintFormatMember () const
 Get member parameter line format string. More...
 

Protected Attributes

std::size_t e1
 Element index of neighbor atom 1 (common feature). More...
 
std::size_t e2
 Element index of neighbor atom 2 (common feature). More...
 
std::vector< bool > calculateExp
 Vector indicating whether exponential term needs to be calculated. More...
 
std::vector< double > factorNorm
 Vector containing precalculated normalizing factor for each zeta. More...
 
std::vector< double > factorDeriv
 Vector containing precalculated normalizing factor for derivatives. More...
 
std::vector< bool > useIntegerPow
 Vector containing values of all member symmetry functions. More...
 
std::vector< int > zetaInt
 Vector containing values of all member symmetry functions. More...
 
std::vector< double > eta
 Vector containing values of all member symmetry functions. More...
 
std::vector< double > zeta
 Vector containing values of all member symmetry functions. More...
 
std::vector< double > lambda
 Vector containing values of all member symmetry functions. More...
 
std::vector< double > zetaLambda
 Vector containing values of all member symmetry functions. More...
 
std::vector< double > rs
 Vector containing values of all member symmetry functions. More...
 
- Protected Attributes inherited from nnp::SymGrpBaseCutoff
double rc
 Cutoff radius \(r_c\) (common feature). More...
 
double cutoffAlpha
 Cutoff function parameter \(\alpha\) (common feature). More...
 
std::string subtype
 Subtype string (specifies cutoff type) (common feature). More...
 
CutoffFunction fc
 Cutoff function used by this symmetry function group. More...
 
CutoffFunction::CutoffType cutoffType
 Cutoff type used by this symmetry function group (common feature). More...
 
- Protected Attributes inherited from nnp::SymGrp
std::size_t type
 Symmetry function type. More...
 
ElementMap elementMap
 Copy of element map. More...
 
std::size_t index
 Symmetry function group index. More...
 
std::size_t ec
 Element index of center atom (common feature). More...
 
double convLength
 Data set normalization length conversion factor. More...
 
std::vector< size_t > memberIndex
 Vector containing indices of all member symmetry functions. More...
 
std::vector< double > scalingFactors
 Scaling factors of all member symmetry functions. More...
 
std::set< std::string > parametersCommon
 Set of common parameters IDs. More...
 
std::set< std::string > parametersMember
 Set of common parameters IDs. More...
 
std::vector< std::vector< std::size_t > > memberIndexPerElement
 Vector containing per-element indices of all member symmetry functions. More...
 

Additional Inherited Members

- Protected Types inherited from nnp::SymGrp
typedef std::map< std::string, std::pair< std::string, std::string > > PrintFormat
 
typedef std::vector< std::string > PrintOrder
 
- Static Protected Member Functions inherited from nnp::SymGrp
static PrintFormat const initializePrintFormat ()
 Initialize static print format map for all possible parameters. More...
 
static PrintOrder const initializePrintOrder ()
 Initialize static print order vector for all possible parameters. More...
 
- Static Protected Attributes inherited from nnp::SymGrp
static PrintFormat const printFormat = initializePrintFormat()
 Map of parameter format strings and empty strings. More...
 
static PrintOrder const printOrder = initializePrintOrder()
 Vector of parameters in order of printing. More...
 

Detailed Description

Definition at line 31 of file SymGrpBaseExpAng.h.

Constructor & Destructor Documentation

◆ SymGrpBaseExpAng()

SymGrpBaseExpAng::SymGrpBaseExpAng ( std::size_t  type,
ElementMap const &  elementMap 
)
protected

Constructor, sets type.

Parameters
[in]typeType of symmetry functions grouped.
[in]elementMapElement Map used.

Definition at line 30 of file SymGrpBaseExpAng.cpp.

30 :
32 e1(0),
33 e2(0)
34{
35 parametersCommon.insert("e1");
36 parametersCommon.insert("e2");
37
38 parametersMember.insert("eta");
39 parametersMember.insert("rs/rl");
40 parametersMember.insert("lambda");
41 parametersMember.insert("zeta");
42 parametersMember.insert("calcexp");
43}
SymGrpBaseCutoff(std::size_t type, ElementMap const &elementMap)
Constructor, sets type.
std::size_t e2
Element index of neighbor atom 2 (common feature).
std::size_t e1
Element index of neighbor atom 1 (common feature).
std::size_t type
Symmetry function type.
Definition: SymGrp.h:106
std::set< std::string > parametersCommon
Set of common parameters IDs.
Definition: SymGrp.h:120
ElementMap elementMap
Copy of element map.
Definition: SymGrp.h:108
std::set< std::string > parametersMember
Set of common parameters IDs.
Definition: SymGrp.h:122

References nnp::SymGrp::parametersCommon, and nnp::SymGrp::parametersMember.

Member Function Documentation

◆ setScalingFactors()

void SymGrpBaseExpAng::setScalingFactors ( )
virtual

Fill scalingFactors with values from member symmetry functions.

Implements nnp::SymGrp.

Definition at line 45 of file SymGrpBaseExpAng.cpp.

46{
47 vector<SymFncBaseExpAng const*> members = getMembers();
48
49 scalingFactors.resize(members.size(), 0.0);
50 for (size_t i = 0; i < members.size(); i++)
51 {
52 scalingFactors.at(i) = members[i]->getScalingFactor();
53 factorNorm.at(i) *= scalingFactors.at(i);
54 }
55
56 return;
57}
std::vector< double > factorNorm
Vector containing precalculated normalizing factor for each zeta.
virtual std::vector< SymFncBaseExpAng const * > getMembers() const =0
Get symmetry function members.
std::vector< double > scalingFactors
Scaling factors of all member symmetry functions.
Definition: SymGrp.h:118

References factorNorm, getMembers(), and nnp::SymGrp::scalingFactors.

Here is the call graph for this function:

◆ parameterLines()

vector< string > SymGrpBaseExpAng::parameterLines ( ) const
virtual

Give symmetry function group parameters on multiple lines.

Returns
Vector of string containing symmetry function parameters lines.

Implements nnp::SymGrp.

Definition at line 59 of file SymGrpBaseExpAng.cpp.

60{
61 vector<string> v;
62 vector<SymFncBaseExpAng const*> members = getMembers();
63
64 v.push_back(strpr(getPrintFormatCommon().c_str(),
65 index + 1,
66 elementMap[ec].c_str(),
67 type,
68 subtype.c_str(),
69 elementMap[e1].c_str(),
70 elementMap[e2].c_str(),
71 rc / convLength,
73
74 for (size_t i = 0; i < members.size(); ++i)
75 {
76 v.push_back(strpr(getPrintFormatMember().c_str(),
77 members[i]->getEta() * convLength * convLength,
78 members[i]->getRs() / convLength,
79 members[i]->getLambda(),
80 members[i]->getZeta(),
81 members[i]->getLineNumber() + 1,
82 i + 1,
83 members[i]->getIndex() + 1,
84 (int)calculateExp[i]));
85 }
86
87 return v;
88}
double cutoffAlpha
Cutoff function parameter (common feature).
std::string subtype
Subtype string (specifies cutoff type) (common feature).
double rc
Cutoff radius (common feature).
std::vector< bool > calculateExp
Vector indicating whether exponential term needs to be calculated.
std::size_t index
Symmetry function group index.
Definition: SymGrp.h:110
std::string getPrintFormatCommon() const
Get common parameter line format string.
Definition: SymGrp.cpp:97
std::size_t ec
Element index of center atom (common feature).
Definition: SymGrp.h:112
double convLength
Data set normalization length conversion factor.
Definition: SymGrp.h:114
std::size_t getIndex() const
Get private index member variable.
Definition: SymGrp.h:184
std::string getPrintFormatMember() const
Get member parameter line format string.
Definition: SymGrp.cpp:130
string strpr(const char *format,...)
String version of printf function.
Definition: utility.cpp:90

References calculateExp, nnp::SymGrp::convLength, nnp::SymGrpBaseCutoff::cutoffAlpha, e1, e2, nnp::SymGrp::ec, nnp::SymGrp::elementMap, nnp::SymGrp::getIndex(), getMembers(), nnp::SymGrp::getPrintFormatCommon(), nnp::SymGrp::getPrintFormatMember(), nnp::SymGrp::index, nnp::SymGrpBaseCutoff::rc, nnp::strpr(), nnp::SymGrpBaseCutoff::subtype, and nnp::SymGrp::type.

Here is the call graph for this function:

◆ getMembers()

virtual std::vector< SymFncBaseExpAng const * > nnp::SymGrpBaseExpAng::getMembers ( ) const
protectedpure virtual

Get symmetry function members.

Returns
Vector of pointers casted to base class.

Implemented in nnp::SymGrpExpAngn, and nnp::SymGrpExpAngw.

Referenced by parameterLines(), and setScalingFactors().

Here is the caller graph for this function:

Member Data Documentation

◆ e1

◆ e2

◆ calculateExp

std::vector<bool> nnp::SymGrpBaseExpAng::calculateExp
protected

Vector indicating whether exponential term needs to be calculated.

Definition at line 61 of file SymGrpBaseExpAng.h.

Referenced by nnp::SymGrpExpAngn::calculate(), nnp::SymGrpExpAngw::calculate(), parameterLines(), nnp::SymGrpExpAngn::sortMembers(), and nnp::SymGrpExpAngw::sortMembers().

◆ factorNorm

std::vector<double> nnp::SymGrpBaseExpAng::factorNorm
protected

Vector containing precalculated normalizing factor for each zeta.

Definition at line 63 of file SymGrpBaseExpAng.h.

Referenced by nnp::SymGrpExpAngn::calculate(), nnp::SymGrpExpAngw::calculate(), setScalingFactors(), nnp::SymGrpExpAngn::sortMembers(), and nnp::SymGrpExpAngw::sortMembers().

◆ factorDeriv

std::vector<double> nnp::SymGrpBaseExpAng::factorDeriv
protected

Vector containing precalculated normalizing factor for derivatives.

Definition at line 65 of file SymGrpBaseExpAng.h.

Referenced by nnp::SymGrpExpAngn::calculate(), nnp::SymGrpExpAngw::calculate(), nnp::SymGrpExpAngn::sortMembers(), and nnp::SymGrpExpAngw::sortMembers().

◆ useIntegerPow

std::vector<bool> nnp::SymGrpBaseExpAng::useIntegerPow
protected

Vector containing values of all member symmetry functions.

Definition at line 67 of file SymGrpBaseExpAng.h.

Referenced by nnp::SymGrpExpAngn::calculate(), nnp::SymGrpExpAngw::calculate(), nnp::SymGrpExpAngn::sortMembers(), and nnp::SymGrpExpAngw::sortMembers().

◆ zetaInt

std::vector<int> nnp::SymGrpBaseExpAng::zetaInt
protected

Vector containing values of all member symmetry functions.

Definition at line 69 of file SymGrpBaseExpAng.h.

Referenced by nnp::SymGrpExpAngn::calculate(), nnp::SymGrpExpAngw::calculate(), nnp::SymGrpExpAngn::sortMembers(), and nnp::SymGrpExpAngw::sortMembers().

◆ eta

std::vector<double> nnp::SymGrpBaseExpAng::eta
protected

Vector containing values of all member symmetry functions.

Definition at line 71 of file SymGrpBaseExpAng.h.

Referenced by nnp::SymGrpExpAngn::calculate(), nnp::SymGrpExpAngw::calculate(), nnp::SymGrpExpAngn::sortMembers(), and nnp::SymGrpExpAngw::sortMembers().

◆ zeta

std::vector<double> nnp::SymGrpBaseExpAng::zeta
protected

Vector containing values of all member symmetry functions.

Definition at line 73 of file SymGrpBaseExpAng.h.

Referenced by nnp::SymGrpExpAngn::calculate(), nnp::SymGrpExpAngw::calculate(), nnp::SymGrpExpAngn::sortMembers(), and nnp::SymGrpExpAngw::sortMembers().

◆ lambda

std::vector<double> nnp::SymGrpBaseExpAng::lambda
protected

Vector containing values of all member symmetry functions.

Definition at line 75 of file SymGrpBaseExpAng.h.

Referenced by nnp::SymGrpExpAngn::calculate(), nnp::SymGrpExpAngw::calculate(), nnp::SymGrpExpAngn::sortMembers(), and nnp::SymGrpExpAngw::sortMembers().

◆ zetaLambda

std::vector<double> nnp::SymGrpBaseExpAng::zetaLambda
protected

Vector containing values of all member symmetry functions.

Definition at line 77 of file SymGrpBaseExpAng.h.

Referenced by nnp::SymGrpExpAngn::calculate(), nnp::SymGrpExpAngw::calculate(), nnp::SymGrpExpAngn::sortMembers(), and nnp::SymGrpExpAngw::sortMembers().

◆ rs

std::vector<double> nnp::SymGrpBaseExpAng::rs
protected

Vector containing values of all member symmetry functions.

Definition at line 79 of file SymGrpBaseExpAng.h.

Referenced by nnp::SymGrpExpAngn::calculate(), nnp::SymGrpExpAngw::calculate(), nnp::SymGrpExpAngn::sortMembers(), and nnp::SymGrpExpAngw::sortMembers().


The documentation for this class was generated from the following files: