|
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. | |
| ~ElementCabana () | |
| Destructor. | |
| 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. | |
| void | changeLengthUnitSymmetryFunctions (double convLength) |
| Change length unit for all symmetry functions. | |
| template<class t_SF, class h_t_int> | |
| void | sortSymmetryFunctions (t_SF SF, h_t_int h_numSFperElem, int attype) |
| Sort all symmetry function. | |
| template<class t_SF> | |
| bool | compareSF (t_SF SF, int attype, int index1, int index2) |
| Print symmetry function parameter value information. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| template<class h_t_int> | |
| std::size_t | numSymmetryFunctions (int attype, h_t_int h_numSFperElem) const |
| Get number of symmetry functions. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| template<class t_SFscaling> | |
| std::string | scalingLine (ScalingType scalingType, t_SFscaling SFscaling, int attype, int k) const |
| Print scaling for one symmetry function. | |
| template<class t_SFscaling> | |
| double | unscale (int attype, double value, int k, t_SFscaling SFscaling) |
| Unscale one symmetry function. | |
| 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. | |
| Element (std::size_t const index, ElementMap const &elementMap) | |
| Constructor using index. | |
| virtual | ~Element () |
| Destructor. | |
| void | clearSymmetryFunctions () |
| Clear all symmetry functions and groups. | |
| void | setAtomicEnergyOffset (double atomicEnergyOffset) |
| Set atomicEnergyOffset. | |
| void | setHardness (double hardness) |
| Set hardness. | |
| void | setQsigma (double qsigma) |
| Set qsigma. | |
| std::size_t | getIndex () const |
| Get index. | |
| std::size_t | getAtomicNumber () const |
| Get atomicNumber. | |
| double | getAtomicEnergyOffset () const |
| Get atomicEnergyOffset. | |
| double | getHardness () const |
| Get hardness. | |
| double | getQsigma () const |
| Get qsigma. | |
| std::string | getSymbol () const |
| Get symbol. | |
| void | addSymmetryFunction (std::string const ¶meters, std::size_t const &lineNumber) |
| Add one symmetry function. | |
| void | changeLengthUnitSymmetryFunctions (double convLength) |
| Change length unit for all symmetry functions. | |
| void | sortSymmetryFunctions () |
| Sort all symmetry function. | |
| std::vector< std::string > | infoSymmetryFunctionParameters () const |
| Print symmetry function parameter value information. | |
| std::vector< std::string > | infoSymmetryFunction (std::size_t index) const |
| Print symmetry function parameter names and values. | |
| std::vector< std::string > | infoSymmetryFunctionScaling () const |
| Print symmetry function scaling information. | |
| void | setupSymmetryFunctionGroups () |
| Set up symmetry function groups. | |
| void | setupSymmetryFunctionMemory () |
| Extract relevant symmetry function combinations for derivative memory. | |
| std::vector< std::string > | infoSymmetryFunctionGroups () const |
| Print symmetry function group info. | |
| void | setCutoffFunction (CutoffFunction::CutoffType const cutoffType, double const cutoffAlpha) |
| Set cutoff function for all symmetry functions. | |
| void | setScalingNone () const |
| Set no scaling of symmetry function. | |
| void | setScaling (SymFnc::ScalingType scalingType, std::vector< std::string > const &statisticsLine, double minS, double maxS) const |
| Set scaling of all symmetry functions. | |
| std::size_t | numSymmetryFunctions () const |
| Get number of symmetry functions. | |
| std::size_t | getMinNeighbors () const |
| Get maximum of required minimum number of neighbors for all symmetry functions for this element. | |
| double | getMinCutoffRadius () const |
| Get minimum cutoff radius of all symmetry functions. | |
| double | getMaxCutoffRadius () const |
| Get maximum cutoff radius of all symmetry functions. | |
| void | getCutoffRadii (std::vector< double > &cutoffs) const |
| Get all different cutoff radii belonging to this element. | |
| std::vector< std::size_t > const & | getSymmetryFunctionNumTable () const |
| Get number of relevant symmetry functions per element. | |
| std::vector< std::vector< std::size_t > > const & | getSymmetryFunctionTable () const |
| Get symmetry function element relevance table. | |
| void | calculateSymmetryFunctions (Atom &atom, bool const derivatives) const |
| Calculate symmetry functions. | |
| void | calculateSymmetryFunctionGroups (Atom &atom, bool const derivatives) const |
| Calculate symmetry functions via groups. | |
| std::size_t | updateSymmetryFunctionStatistics (Atom const &atom) |
| Update symmetry function statistics. | |
| SymFnc const & | getSymmetryFunction (std::size_t index) const |
| Get symmetry function instance. | |
| void | setCacheIndices (std::vector< std::vector< SFCacheList > > cacheLists) |
| Set cache indices for all symmetry functions of this element. | |
| std::vector< std::size_t > | getCacheSizes () const |
| Get cache sizes for each neighbor atom element. | |
Private Attributes | |
| std::size_t | index |
| Global index of this element. | |
| std::size_t | atomicNumber |
| Atomic number of this element. | |
| double | atomicEnergyOffset |
| Offset energy for every atom of this element. | |
| std::string | symbol |
| Element symbol. | |
Additional Inherited Members | |
Public Attributes inherited from nnp::Element | |
| std::map< std::string, NeuralNetwork > | neuralNetworks |
| Neural networks for this element. | |
| SymFncStatistics | statistics |
| Symmetry function statistics. | |
Protected Attributes inherited from nnp::Element | |
| ElementMap | elementMap |
| Copy of element map. | |
| std::size_t | index |
| Global index of this element. | |
| std::size_t | atomicNumber |
| Atomic number of this element. | |
| double | atomicEnergyOffset |
| Offset energy for every atom of this element. | |
| double | hardness |
| Atomic hardness for global charge equilibration. | |
| double | qsigma |
| Gaussian width of charge distribution. | |
| std::string | symbol |
| Element symbol. | |
| std::vector< std::size_t > | symmetryFunctionNumTable |
| Number of relevant symmetry functions for each neighbor element. | |
| std::vector< std::vector< std::size_t > > | symmetryFunctionTable |
| List of symmetry function indices relevant for each neighbor element. | |
| std::vector< std::vector< SFCacheList > > | cacheLists |
| Symmetry function cache lists. | |
| std::vector< SymFnc * > | symmetryFunctions |
| Vector of pointers to symmetry functions. | |
| std::vector< SymGrp * > | symmetryFunctionGroups |
| Vector of pointers to symmetry function groups. | |
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, nnp::Element::Element(), 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. |
References nnp::Element::atomicEnergyOffset, nnp::Element::atomicNumber, nnp::Element::index, and nnp::Element::symbol.
| 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().