n2p2 - A neural network potential package
ErfcBuf.h
Go to the documentation of this file.
1//
2// Created by philipp on 5/23/22.
3//
4
5#ifndef N2P2_ERFCBUF_H
6#define N2P2_ERFCBUF_H
7
8#include "Atom.h"
9#include <vector>
10
11
12namespace nnp
13{
16 struct ErfcBuf
17 {
24 void reset(std::vector<Atom> const& atoms, size_t const valuesPerPair);
34 double getf(size_t const atomIndex,
35 size_t const neighIndex,
36 size_t const valIndex,
37 double const x);
38
41 std::vector<std::vector<double>> f;
44 size_t numValuesPerPair = 1;
45 };
46
47} // nnp
48
49#endif //N2P2_ERFCBUF_H
Definition: Atom.h:29
Helper class to store previously calculated values of erfc() that are needed during the charge equili...
Definition: ErfcBuf.h:17
std::vector< std::vector< double > > f
2d vector to store already calculated results.
Definition: ErfcBuf.h:41
size_t numValuesPerPair
Typically one needs erfc(a_i * rij), where the number of a_i's correspond to numValuesPerPair.
Definition: ErfcBuf.h:44
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.
Definition: ErfcBuf.cpp:21
void reset(std::vector< Atom > const &atoms, size_t const valuesPerPair)
Resizes and resets the storage array to fit the current structure.
Definition: ErfcBuf.cpp:10