Memory layout

Configuration storage

struct nnp::Atom

Storage for a single atom.

Public Members

std::size_t index

Index number of this atom.

std::size_t element

Element index of this atom.

double energy

Atomic energy determined by neural network.

double charge

Atomic charge determined by neural network.

Vec3D r

Cartesian coordinates.

Vec3D f

Force vector calculated by neural network.

Vec3D fRef

Reference force vector from data set.

std::vector<double> G

Symmetry function values.

std::vector<double> dEdG

Derivative of atomic energy with respect to symmetry functions.

std::vector<Vec3D> dGdr

Derivative of symmetry functions with respect to this atom’s coordinates.

std::vector<Neighbor> neighbors

Neighbor array (maximum number defined in macros.h.

struct nnp::Atom::Neighbor

Struct to store information on neighbor atoms.

Public Members

std::size_t index

Index of neighbor atom.

std::size_t element

Element index of neighbor atom.

double d

Distance to neighbor atom.

Vec3D dr

Distance vector to neighbor atom.

std::vector<Vec3D> dGdr

Derivatives of symmetry functions with respect to neighbor coordinates.

May be empty, only filled when needed. Contains \( \frac{\partial G_i}{\partial \alpha_j} \), where \(G_i\) is a symmetry function of atom \(i\) and \(\alpha_j\) is a coordinate \( \alpha = x,y,z \) of neighbor atom \( j \), necessary for force calculation.

struct nnp::Structure

Storage for one atomic configuration.

Public Members

std::size_t index

Index number of this structure.

double energy

Potential energy determined by neural network.

double energyRef

Reference potential energy.

double chargeRef

Reference charge.

Vec3D box[3]

Simulation box vectors.

std::vector<Atom> atoms

Vector of all atoms in this structure.

class nnp::Dataset : public nnp::Mode

Collect and process large data sets.

Subclassed by nnp::Training

Public Members

std::vector<Structure> structures

All structures in this dataset.

Helper classes and functions

class nnp::ElementMap

Contains element map.

Public Functions

inline std::string operator[](std::size_t const index) const

Overload [] operator for index search.


index[in] Element index.


Symbol of element in map.

inline std::size_t operator[](std::string const symbol) const

Overload [] operator for symbol search.


symbol[in] Element symbol.


Index of element in map.

struct nnp::Vec3D

Vector in 3 dimensional real space.

Public Functions

inline double norm() const

Calculate norm of vector.


Norm of vector.

inline double norm2() const

Calculate square of norm of vector.


Square of norm of vector.

inline Vec3D &normalize()

Normalize vector, norm equals 1.0 afterwards.

inline Vec3D cross(Vec3D const &v) const

Cross product, argument vector is second in product.


Cross product of two vectors.

Public Members

double r[3]

cartesian coordinates.

vector<string> nnp::split(std::string const &input, char delimiter = ' ')

Split string at each delimiter.

  • input[in] Input string.

  • delimiter[in] Delimiter character (default ‘ ‘).


Vector containing the string parts.

string nnp::strpr(const char *format, ...)

String version of printf function.