n2p2 - A neural network potential package
|
Helper class to store previously calculated values of erfc() that are needed during the charge equilibration. More...
#include <ErfcBuf.h>
Public Member Functions | |
void | reset (std::vector< Atom > const &atoms, size_t const valuesPerPair) |
Resizes and resets the storage array to fit the current structure. More... | |
double | getf (size_t const atomIndex, size_t const neighIndex, size_t const valIndex, double const x) |
Either returns already stored value erfc(x) or calculates it if not yet stored. More... | |
Public Attributes | |
std::vector< std::vector< double > > | f |
2d vector to store already calculated results. More... | |
size_t | numValuesPerPair = 1 |
Typically one needs erfc(a_i * rij), where the number of a_i's correspond to numValuesPerPair. More... | |
Helper class to store previously calculated values of erfc() that are needed during the charge equilibration.
void ErfcBuf::reset | ( | std::vector< Atom > const & | atoms, |
size_t const | valuesPerPair | ||
) |
Resizes and resets the storage array to fit the current structure.
[in] | atoms | Vector of atoms of the structure. |
[in] | valuesPerPair | Number of values that are stored for each neighbor pair (intended use is for erfc(rij...)). |
Definition at line 10 of file ErfcBuf.cpp.
References f, and numValuesPerPair.
Referenced by nnp::Structure::calculateElectrostaticEnergy().
double ErfcBuf::getf | ( | size_t const | atomIndex, |
size_t const | neighIndex, | ||
size_t const | valIndex, | ||
double const | x | ||
) |
Either returns already stored value erfc(x) or calculates it if not yet stored.
[in] | atomIndex | Index of atom. |
[in] | neighIndex | Index of neighbor of this atom. |
[in] | valIndex | Index corresponds to the value that is requested, see numValuesPerPair. |
[in] | x | Corresponds to erfc(x). Only used when result is not stored yet. |
Definition at line 21 of file ErfcBuf.cpp.
References f, and numValuesPerPair.
Referenced by nnp::Structure::calculateDAdrQ(), and nnp::Structure::calculateElectrostaticEnergy().
std::vector<std::vector<double> > nnp::ErfcBuf::f |
size_t nnp::ErfcBuf::numValuesPerPair = 1 |