n2p2 - A neural network potential package
|
Derived Cabana class for element-specific data. More...
#include <ElementCabana.h>
Public Member Functions | |
ElementCabana (std::size_t const index) | |
Constructor using index. More... | |
~ElementCabana () | |
Destructor. More... | |
template<class t_SF , class h_t_int > | |
void | addSymmetryFunction (std::string const ¶meters, std::vector< std::string > elementStrings, int attype, t_SF SF, double convLength, h_t_int h_numSFperElem) |
Add one symmetry function. More... | |
void | changeLengthUnitSymmetryFunctions (double convLength) |
Change length unit for all symmetry functions. More... | |
template<class t_SF , class h_t_int > | |
void | sortSymmetryFunctions (t_SF SF, h_t_int h_numSFperElem, int attype) |
Sort all symmetry function. More... | |
template<class t_SF > | |
bool | compareSF (t_SF SF, int attype, int index1, int index2) |
Print symmetry function parameter value information. More... | |
template<class t_SF , class h_t_int > | |
std::vector< std::string > | infoSymmetryFunctionParameters (t_SF SF, int attype, h_t_int h_numSFperElem) const |
Print symmetry function parameter value information. More... | |
template<class t_SF , class t_SFscaling , class h_t_int > | |
std::vector< std::string > | infoSymmetryFunctionScaling (ScalingType scalingType, t_SF SF, t_SFscaling SFscaling, int attype, h_t_int h_numSFperElem) const |
Print symmetry function scaling information. More... | |
template<class t_SF , class t_SFGmemberlist , class h_t_int > | |
void | setupSymmetryFunctionGroups (t_SF SF, t_SFGmemberlist SFGmemberlist, int attype, h_t_int h_numSFperElem, h_t_int h_numSFGperElem, int maxSFperElem) |
Set up symmetry function groups. More... | |
template<class t_SF , class t_SFGmemberlist , class h_t_int > | |
std::vector< std::string > | infoSymmetryFunctionGroups (t_SF SF, t_SFGmemberlist SFGmemberlist, int attype, h_t_int h_numSFGperElem) const |
Print symmetry function group info. More... | |
template<class t_SF , class h_t_int > | |
void | setCutoffFunction (CutoffFunction::CutoffType const cutoffType, double const cutoffAlpha, t_SF SF, int attype, h_t_int h_numSFperElem) |
Set cutoff function for all symmetry functions. More... | |
template<class t_SF , class t_SFscaling , class h_t_int > | |
void | setScaling (ScalingType scalingType, std::vector< std::string > const &statisticsLine, double minS, double maxS, t_SF SF, t_SFscaling SFscaling, int attype, h_t_int h_numSFperElem) const |
Set scaling of all symmetry functions. More... | |
template<class h_t_int > | |
std::size_t | numSymmetryFunctions (int attype, h_t_int h_numSFperElem) const |
Get number of symmetry functions. More... | |
template<class t_SF > | |
std::size_t | getMinNeighbors (int attype, t_SF SF, int nSF) const |
Get maximum of required minimum number of neighbors for all symmetry functions for this element. More... | |
template<class t_SF , class h_t_int > | |
double | getMinCutoffRadius (t_SF SF, int attype, h_t_int h_numSFperElem) const |
Get minimum cutoff radius of all symmetry functions. More... | |
template<class t_SF , class h_t_int > | |
double | getMaxCutoffRadius (t_SF SF, int attype, h_t_int h_numSFperElem) const |
Get maximum cutoff radius of all symmetry functions. More... | |
template<class t_SFscaling > | |
void | setScalingType (ScalingType scalingType, std::string statisticsLine, double Smin, double Smax, t_SFscaling SFscaling, int attype, int k) const |
Symmetry function statistics. More... | |
template<class t_SFscaling > | |
std::string | scalingLine (ScalingType scalingType, t_SFscaling SFscaling, int attype, int k) const |
Print scaling for one symmetry function. More... | |
template<class t_SFscaling > | |
double | unscale (int attype, double value, int k, t_SFscaling SFscaling) |
Unscale one symmetry function. More... | |
template<class t_SF , class h_t_int > | |
vector< string > | infoSymmetryFunctionParameters (t_SF SF, int attype, h_t_int h_numSFperElem) const |
template<class t_SF , class t_SFscaling , class h_t_int > | |
vector< string > | infoSymmetryFunctionScaling (ScalingType scalingType, t_SF SF, t_SFscaling SFscaling, int attype, h_t_int h_numSFperElem) const |
template<class t_SF , class t_SFGmemberlist , class h_t_int > | |
vector< string > | infoSymmetryFunctionGroups (t_SF SF, t_SFGmemberlist SFGmemberlist, int attype, h_t_int h_numSFGperElem) const |
template<class t_SF > | |
size_t | getMinNeighbors (int attype, t_SF SF, int nSF) const |
Public Member Functions inherited from nnp::Element | |
Element () | |
Default constructor. More... | |
Element (std::size_t const index, ElementMap const &elementMap) | |
Constructor using index. More... | |
virtual | ~Element () |
Destructor. More... | |
void | clearSymmetryFunctions () |
Clear all symmetry functions and groups. More... | |
void | setAtomicEnergyOffset (double atomicEnergyOffset) |
Set atomicEnergyOffset. More... | |
void | setHardness (double hardness) |
Set hardness. More... | |
void | setQsigma (double qsigma) |
Set qsigma. More... | |
std::size_t | getIndex () const |
Get index. More... | |
std::size_t | getAtomicNumber () const |
Get atomicNumber. More... | |
double | getAtomicEnergyOffset () const |
Get atomicEnergyOffset. More... | |
double | getHardness () const |
Get hardness. More... | |
double | getQsigma () const |
Get qsigma. More... | |
std::string | getSymbol () const |
Get symbol. More... | |
void | addSymmetryFunction (std::string const ¶meters, std::size_t const &lineNumber) |
Add one symmetry function. More... | |
void | changeLengthUnitSymmetryFunctions (double convLength) |
Change length unit for all symmetry functions. More... | |
void | sortSymmetryFunctions () |
Sort all symmetry function. More... | |
std::vector< std::string > | infoSymmetryFunctionParameters () const |
Print symmetry function parameter value information. More... | |
std::vector< std::string > | infoSymmetryFunction (std::size_t index) const |
Print symmetry function parameter names and values. More... | |
std::vector< std::string > | infoSymmetryFunctionScaling () const |
Print symmetry function scaling information. More... | |
void | setupSymmetryFunctionGroups () |
Set up symmetry function groups. More... | |
void | setupSymmetryFunctionMemory () |
Extract relevant symmetry function combinations for derivative memory. More... | |
std::vector< std::string > | infoSymmetryFunctionGroups () const |
Print symmetry function group info. More... | |
void | setCutoffFunction (CutoffFunction::CutoffType const cutoffType, double const cutoffAlpha) |
Set cutoff function for all symmetry functions. More... | |
void | setScalingNone () const |
Set no scaling of symmetry function. More... | |
void | setScaling (SymFnc::ScalingType scalingType, std::vector< std::string > const &statisticsLine, double minS, double maxS) const |
Set scaling of all symmetry functions. More... | |
std::size_t | numSymmetryFunctions () const |
Get number of symmetry functions. More... | |
std::size_t | getMinNeighbors () const |
Get maximum of required minimum number of neighbors for all symmetry functions for this element. More... | |
double | getMinCutoffRadius () const |
Get minimum cutoff radius of all symmetry functions. More... | |
double | getMaxCutoffRadius () const |
Get maximum cutoff radius of all symmetry functions. More... | |
void | getCutoffRadii (std::vector< double > &cutoffs) const |
Get all different cutoff radii belonging to this element. More... | |
std::vector< std::size_t > const & | getSymmetryFunctionNumTable () const |
Get number of relevant symmetry functions per element. More... | |
std::vector< std::vector< std::size_t > > const & | getSymmetryFunctionTable () const |
Get symmetry function element relevance table. More... | |
void | calculateSymmetryFunctions (Atom &atom, bool const derivatives) const |
Calculate symmetry functions. More... | |
void | calculateSymmetryFunctionGroups (Atom &atom, bool const derivatives) const |
Calculate symmetry functions via groups. More... | |
std::size_t | updateSymmetryFunctionStatistics (Atom const &atom) |
Update symmetry function statistics. More... | |
SymFnc const & | getSymmetryFunction (std::size_t index) const |
Get symmetry function instance. More... | |
void | setCacheIndices (std::vector< std::vector< SFCacheList > > cacheLists) |
Set cache indices for all symmetry functions of this element. More... | |
std::vector< std::size_t > | getCacheSizes () const |
Get cache sizes for each neighbor atom element. More... | |
Private Attributes | |
std::size_t | index |
Global index of this element. More... | |
std::size_t | atomicNumber |
Atomic number of this element. More... | |
double | atomicEnergyOffset |
Offset energy for every atom of this element. More... | |
std::string | symbol |
Element symbol. More... | |
Additional Inherited Members | |
Public Attributes inherited from nnp::Element | |
std::map< std::string, NeuralNetwork > | neuralNetworks |
Neural networks for this element. More... | |
SymFncStatistics | statistics |
Symmetry function statistics. More... | |
Protected Attributes inherited from nnp::Element | |
ElementMap | elementMap |
Copy of element map. More... | |
std::size_t | index |
Global index of this element. More... | |
std::size_t | atomicNumber |
Atomic number of this element. More... | |
double | atomicEnergyOffset |
Offset energy for every atom of this element. More... | |
double | hardness |
Atomic hardness for global charge equilibration. More... | |
double | qsigma |
Gaussian width of charge distribution. More... | |
std::string | symbol |
Element symbol. More... | |
std::vector< std::size_t > | symmetryFunctionNumTable |
Number of relevant symmetry functions for each neighbor element. More... | |
std::vector< std::vector< std::size_t > > | symmetryFunctionTable |
List of symmetry function indices relevant for each neighbor element. More... | |
std::vector< std::vector< SFCacheList > > | cacheLists |
Symmetry function cache lists. More... | |
std::vector< SymFnc * > | symmetryFunctions |
Vector of pointers to symmetry functions. More... | |
std::vector< SymGrp * > | symmetryFunctionGroups |
Vector of pointers to symmetry function groups. More... | |
Derived Cabana class for element-specific data.
Definition at line 35 of file ElementCabana.h.
nnp::ElementCabana::ElementCabana | ( | std::size_t const | index | ) |
Constructor using index.
Definition at line 31 of file ElementCabana_impl.h.
References atomicEnergyOffset, and index.
nnp::ElementCabana::~ElementCabana | ( | ) |
void nnp::ElementCabana::addSymmetryFunction | ( | std::string const & | parameters, |
std::vector< std::string > | elementStrings, | ||
int | attype, | ||
t_SF | SF, | ||
double | convLength, | ||
h_t_int | h_numSFperElem | ||
) |
Add one symmetry function.
[in] | parameters | String containing settings for symmetry function. |
[in] | lineNumber | Line number of symmetry function in settings file. |
[in] | attype | Atom type. |
[in] | SF | Kokkos host View of symmetry functions. |
[in] | convLength | Length unit conversion factor. |
[in] | h_numSFperElem | Kokkos host View of number of symmetry functions per element. |
Definition at line 42 of file ElementCabana_impl.h.
References nnp::reduce(), and nnp::split().
void nnp::ElementCabana::changeLengthUnitSymmetryFunctions | ( | double | convLength | ) |
Change length unit for all symmetry functions.
[in] | convLength | Length unit conversion factor. |
void nnp::ElementCabana::sortSymmetryFunctions | ( | t_SF | SF, |
h_t_int | h_numSFperElem, | ||
int | attype | ||
) |
Sort all symmetry function.
[in] | SF | Kokkos host View of symmetry functions. |
[in] | h_numSFperElem | Kokkos host View of number of symmetry functions per element. |
[in] | attype | Atom type. |
Definition at line 169 of file ElementCabana_impl.h.
References compareSF().
bool nnp::ElementCabana::compareSF | ( | t_SF | SF, |
int | attype, | ||
int | index1, | ||
int | index2 | ||
) |
Print symmetry function parameter value information.
[in] | SF | Kokkos host View of symmetry functions. |
[in] | attype | Atom type. |
[in] | index1 | First symmetry function index. |
[in] | index2 | Second symmetry function index. |
Definition at line 205 of file ElementCabana_impl.h.
Referenced by sortSymmetryFunctions().
std::vector< std::string > nnp::ElementCabana::infoSymmetryFunctionParameters | ( | t_SF | SF, |
int | attype, | ||
h_t_int | h_numSFperElem | ||
) | const |
Print symmetry function parameter value information.
[in] | SF | Kokkos host View of symmetry functions. |
[in] | attype | Atom type. |
[in] | h_numSFperElem | Kokkos host View of number of symmetry functions per element. |
std::vector< std::string > nnp::ElementCabana::infoSymmetryFunctionScaling | ( | ScalingType | scalingType, |
t_SF | SF, | ||
t_SFscaling | SFscaling, | ||
int | attype, | ||
h_t_int | h_numSFperElem | ||
) | const |
Print symmetry function scaling information.
[in] | scalingType | Type of scaling see SymmetryFunction::ScalingType. |
[in] | SF | Kokkos host View of symmetry functions. |
[in] | SFscaling | Kokkos host View of symmetry function scaling. |
[in] | attype | Atom type. |
[in] | h_numSFperElem | Kokkos host View of number of symmetry functions per element. |
void nnp::ElementCabana::setupSymmetryFunctionGroups | ( | t_SF | SF, |
t_SFGmemberlist | SFGmemberlist, | ||
int | attype, | ||
h_t_int | h_numSFperElem, | ||
h_t_int | h_numSFGperElem, | ||
int | maxSFperElem | ||
) |
Set up symmetry function groups.
[in] | SF | Kokkos host View of symmetry functions. |
[in] | SFGmemberlist | Kokkos host View of symmetry function groups. |
[in] | attype | Atom type. |
[in] | h_numSFperElem | Kokkos host View of number of symmetry functions per element. |
[in] | h_numSFGperElem | Kokkos host View of number of symmetry function groups per element. |
[in] | maxSFperElem | Maximum number of symmetry functions per element. |
Definition at line 308 of file ElementCabana_impl.h.
std::vector< std::string > nnp::ElementCabana::infoSymmetryFunctionGroups | ( | t_SF | SF, |
t_SFGmemberlist | SFGmemberlist, | ||
int | attype, | ||
h_t_int | h_numSFGperElem | ||
) | const |
Print symmetry function group info.
[in] | SF | Kokkos host View of symmetry functions. |
[in] | SFGmemberlist | Kokkos host View of symmetry function groups. |
[in] | attype | Atom type. |
[in] | h_numSFGperElem | Kokkos host View of number of symmetry function groups per element. |
void nnp::ElementCabana::setCutoffFunction | ( | CutoffFunction::CutoffType const | cutoffType, |
double const | cutoffAlpha, | ||
t_SF | SF, | ||
int | attype, | ||
h_t_int | h_numSFperElem | ||
) |
Set cutoff function for all symmetry functions.
[in] | cutoffType | Type of cutoff function. |
[in] | cutoffAlpha | Cutoff parameter for all functions. |
[in] | SF | Kokkos host View of symmetry functions. |
[in] | attype | Atom type. |
[in] | h_numSFperElem | Kokkos host View of number of symmetry functions per element. |
Definition at line 412 of file ElementCabana_impl.h.
void nnp::ElementCabana::setScaling | ( | ScalingType | scalingType, |
std::vector< std::string > const & | statisticsLine, | ||
double | minS, | ||
double | maxS, | ||
t_SF | SF, | ||
t_SFscaling | SFscaling, | ||
int | attype, | ||
h_t_int | h_numSFperElem | ||
) | const |
Set scaling of all symmetry functions.
[in] | scalingType | Type of scaling, see SymmetryFunction::ScalingType. |
[in] | statisticsLine | Vector of strings containing statistics for all symmetry functions. |
[in] | minS | Minimum for scaling range. |
[in] | maxS | Maximum for scaling range. |
[in] | SF | Kokkos host View of symmetry functions. |
[in] | SFscaling | Kokkos host View of symmetry function scaling. |
[in] | attype | Atom type. |
[in] | h_numSFperElem | Kokkos host View of number of symmetry functions per element. |
Definition at line 425 of file ElementCabana_impl.h.
References index, and setScalingType().
|
inline |
Get number of symmetry functions.
[in] | attype | Atom type. |
[in] | h_numSFperElem | Kokkos host View of number of symmetry functions per element. |
Definition at line 278 of file ElementCabana.h.
std::size_t nnp::ElementCabana::getMinNeighbors | ( | int | attype, |
t_SF | SF, | ||
int | nSF | ||
) | const |
Get maximum of required minimum number of neighbors for all symmetry functions for this element.
[in] | attype | Atom type. |
[in] | h_numSFperElem | Kokkos host View of number of symmetry functions per element. |
[in] | nSF | Number of symmetry function for this type. |
double nnp::ElementCabana::getMinCutoffRadius | ( | t_SF | SF, |
int | attype, | ||
h_t_int | h_numSFperElem | ||
) | const |
Get minimum cutoff radius of all symmetry functions.
[in] | SF | Kokkos host View of symmetry functions. |
[in] | attype | Atom type. |
[in] | h_numSFperElem | Kokkos host View of number of symmetry functions per element. |
Definition at line 465 of file ElementCabana_impl.h.
double nnp::ElementCabana::getMaxCutoffRadius | ( | t_SF | SF, |
int | attype, | ||
h_t_int | h_numSFperElem | ||
) | const |
Get maximum cutoff radius of all symmetry functions.
[in] | SF | Kokkos host View of symmetry functions. |
[in] | attype | Atom type. |
[in] | h_numSFperElem | Kokkos host View of number of symmetry functions per element. |
Definition at line 477 of file ElementCabana_impl.h.
|
inline |
Symmetry function statistics.
Set scaling type of one symmetry function
[in] | scalingType | Type of scaling, see SymmetryFunction::ScalingType. |
[in] | statisticsLine | Output string for this symmetry function. |
[in] | Smin | Minimum for scaling range. |
[in] | Smax | Maximum for scaling range. |
[in] | SFscaling | Kokkos host View of symmetry function scaling. |
[in] | attype | Atom type. |
[in] | k | Symmetry function index. |
Definition at line 286 of file ElementCabana.h.
References nnp::reduce(), nnp::split(), ST_CENTER, ST_NONE, ST_SCALE, ST_SCALECENTER, and ST_SCALESIGMA.
Referenced by setScaling().
|
inline |
Print scaling for one symmetry function.
[in] | scalingType | Type of scaling, see SymmetryFunction::ScalingType. |
[in] | SFscaling | Kokkos host View of symmetry function scaling. |
[in] | attype | Atom type. |
[in] | k | Symmetry function index. |
Definition at line 327 of file ElementCabana.h.
References nnp::strpr().
Referenced by infoSymmetryFunctionScaling().
|
inline |
Unscale one symmetry function.
[in] | attype | Atom type. |
[in] | value | Unscaled symmetry function value. |
[in] | k | Symmetry function index. |
[in] | SFscaling | Kokkos host View of symmetry function scaling. |
Definition at line 340 of file ElementCabana.h.
vector< string > nnp::ElementCabana::infoSymmetryFunctionParameters | ( | t_SF | SF, |
int | attype, | ||
h_t_int | h_numSFperElem | ||
) | const |
Definition at line 268 of file ElementCabana_impl.h.
References index.
vector< string > nnp::ElementCabana::infoSymmetryFunctionScaling | ( | ScalingType | scalingType, |
t_SF | SF, | ||
t_SFscaling | SFscaling, | ||
int | attype, | ||
h_t_int | h_numSFperElem | ||
) | const |
Definition at line 293 of file ElementCabana_impl.h.
References index, and scalingLine().
vector< string > nnp::ElementCabana::infoSymmetryFunctionGroups | ( | t_SF | SF, |
t_SFGmemberlist | SFGmemberlist, | ||
int | attype, | ||
h_t_int | h_numSFGperElem | ||
) | const |
Definition at line 390 of file ElementCabana_impl.h.
size_t nnp::ElementCabana::getMinNeighbors | ( | int | attype, |
t_SF | SF, | ||
int | nSF | ||
) | const |
Definition at line 445 of file ElementCabana_impl.h.
|
private |
Global index of this element.
Definition at line 255 of file Element.h.
Referenced by ElementCabana(), infoSymmetryFunctionParameters(), infoSymmetryFunctionScaling(), and setScaling().
|
private |
|
private |
Offset energy for every atom of this element.
Definition at line 259 of file Element.h.
Referenced by ElementCabana().