Loading [MathJax]/extensions/TeX/AMSmath.js
n2p2 - A neural network potential package
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
nnp::SymGrpBaseCompAngWeighted Class Referenceabstract

#include <SymGrpBaseCompAngWeighted.h>

Inheritance diagram for nnp::SymGrpBaseCompAngWeighted:
Collaboration diagram for nnp::SymGrpBaseCompAngWeighted:

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

std::vector< bool > calculateComp
 Vector indicating whether compact function needs to be recalculated.
 
std::vector< double > mrl
 Member rl.
 
std::vector< double > mrc
 Member rc.
 
std::vector< double > mal
 Member angleLeft.
 
std::vector< double > mar
 Member angleRight.
 
std::vector< std::vector< std::vector< std::size_t > > > mci
 Member cache indices for actual neighbor element.
 
- Protected Attributes inherited from nnp::SymGrpBaseComp
double rmin
 Minimum radius within group.
 
double rmax
 Maximum radius within group.
 
- Protected Attributes inherited from nnp::SymGrp
std::size_t type
 Symmetry function type.
 
ElementMap elementMap
 Copy of element map.
 
std::size_t index
 Symmetry function group index.
 
std::size_t ec
 Element index of center atom (common feature).
 
double convLength
 Data set normalization length conversion factor.
 
std::vector< size_t > memberIndex
 Vector containing indices of all member symmetry functions.
 
std::vector< double > scalingFactors
 Scaling factors of all member symmetry functions.
 
std::set< std::string > parametersCommon
 Set of common parameters IDs.
 
std::set< std::string > parametersMember
 Set of common parameters IDs.
 
std::vector< std::vector< std::size_t > > memberIndexPerElement
 Vector containing per-element indices of all member symmetry functions.
 

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.
 
static PrintOrder const initializePrintOrder ()
 Initialize static print order vector for all possible parameters.
 
- Static Protected Attributes inherited from nnp::SymGrp
static PrintFormat const printFormat = initializePrintFormat()
 Map of parameter format strings and empty strings.
 
static PrintOrder const printOrder = initializePrintOrder()
 Vector of parameters in order of printing.
 

Detailed Description

Definition at line 32 of file SymGrpBaseCompAngWeighted.h.

Constructor & Destructor Documentation

◆ SymGrpBaseCompAngWeighted()

SymGrpBaseCompAngWeighted::SymGrpBaseCompAngWeighted ( 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 SymGrpBaseCompAngWeighted.cpp.

31 :
33{
34 parametersMember.insert("angleLeft");
35 parametersMember.insert("angleRight");
36 parametersMember.insert("calcexp");
37}
SymGrpBaseComp(std::size_t type, ElementMap const &elementMap)
Constructor, sets type.
std::size_t type
Symmetry function type.
Definition SymGrp.h:106
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::elementMap, nnp::SymGrp::parametersMember, nnp::SymGrpBaseComp::SymGrpBaseComp(), and nnp::SymGrp::type.

Referenced by nnp::SymGrpCompAngnWeighted::SymGrpCompAngnWeighted(), and nnp::SymGrpCompAngwWeighted::SymGrpCompAngwWeighted().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ setScalingFactors()

void SymGrpBaseCompAngWeighted::setScalingFactors ( )
virtual

Fill scalingFactors with values from member symmetry functions.

Implements nnp::SymGrp.

Definition at line 39 of file SymGrpBaseCompAngWeighted.cpp.

40{
41 vector<SymFncBaseCompAngWeighted const*> members = getMembers();
42 scalingFactors.resize(members.size(), 0.0);
43 for (size_t i = 0; i < members.size(); i++)
44 {
45 scalingFactors.at(i) = members[i]->getScalingFactor();
46 }
47
48 return;
49}
virtual std::vector< SymFncBaseCompAngWeighted const * > getMembers() const =0
Get symmetry function members.
std::vector< double > scalingFactors
Scaling factors of all member symmetry functions.
Definition SymGrp.h:118

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

Here is the call graph for this function:

◆ parameterLines()

vector< string > SymGrpBaseCompAngWeighted::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 51 of file SymGrpBaseCompAngWeighted.cpp.

52{
53 vector<string> v;
54 vector<SymFncBaseCompAngWeighted const*> members = getMembers();
55
56 v.push_back(strpr(getPrintFormatCommon().c_str(),
57 index + 1,
58 elementMap[ec].c_str(),
59 type,
61 rmax / convLength));
62
63 for (size_t i = 0; i < members.size(); ++i)
64 {
65 v.push_back(strpr(getPrintFormatMember().c_str(),
66 members[i]->getSubtype().c_str(),
67 members[i]->getRl() / convLength,
68 members[i]->getRc() / convLength,
69 members[i]->getAngleLeft(),
70 members[i]->getAngleRight(),
71 members[i]->getLineNumber() + 1,
72 i + 1,
73 members[i]->getIndex() + 1,
74 calculateComp[i]));
75 }
76
77 return v;
78}
std::vector< bool > calculateComp
Vector indicating whether compact function needs to be recalculated.
double rmin
Minimum radius within group.
double rmax
Maximum radius within group.
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 calculateComp, nnp::SymGrp::convLength, nnp::SymGrp::ec, nnp::SymGrp::elementMap, nnp::SymGrp::getIndex(), getMembers(), nnp::SymGrp::getPrintFormatCommon(), nnp::SymGrp::getPrintFormatMember(), nnp::SymGrp::index, nnp::SymGrpBaseComp::rmax, nnp::SymGrpBaseComp::rmin, nnp::strpr(), and nnp::SymGrp::type.

Here is the call graph for this function:

◆ getMembers()

virtual std::vector< SymFncBaseCompAngWeighted const * > nnp::SymGrpBaseCompAngWeighted::getMembers ( ) const
protectedpure virtual

Get symmetry function members.

Returns
Vector of pointers casted to base class.

Implemented in nnp::SymGrpCompAngnWeighted, and nnp::SymGrpCompAngwWeighted.

Referenced by parameterLines(), and setScalingFactors().

Here is the caller graph for this function:

Member Data Documentation

◆ calculateComp

std::vector<bool> nnp::SymGrpBaseCompAngWeighted::calculateComp
protected

Vector indicating whether compact function needs to be recalculated.

Definition at line 59 of file SymGrpBaseCompAngWeighted.h.

Referenced by nnp::SymGrpCompAngnWeighted::calculate(), parameterLines(), nnp::SymGrpCompAngnWeighted::sortMembers(), and nnp::SymGrpCompAngwWeighted::sortMembers().

◆ mrl

std::vector<double> nnp::SymGrpBaseCompAngWeighted::mrl
protected

◆ mrc

std::vector<double> nnp::SymGrpBaseCompAngWeighted::mrc
protected

◆ mal

std::vector<double> nnp::SymGrpBaseCompAngWeighted::mal
protected

◆ mar

std::vector<double> nnp::SymGrpBaseCompAngWeighted::mar
protected

◆ mci

std::vector<std::vector< std::vector<std::size_t> > > nnp::SymGrpBaseCompAngWeighted::mci
protected

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