24#include <unordered_map>
47#ifndef N2P2_NO_SF_CACHE
87 std::vector<std::string>
info()
const;
141#ifndef N2P2_NO_SF_CACHE
146 std::vector<double>
G;
154#ifdef N2P2_FULL_SFD_MEMORY
157 std::vector<double> dGdxia;
177#ifdef N2P2_FULL_SFD_MEMORY
196 void collectDGdxia(std::size_t indexAtom,
197 std::size_t indexComponent,
198 double maxCutoffRadius);
230 double const maxCutoffRadius = 0.0);
238 void free(
bool all,
double const maxCutoffRadius = 0.0);
271 double const cutoffRadius)
const;
286 std::string
const& property,
287 std::map<std::string, double>& error,
288 std::size_t& count)
const;
304 std::vector<std::vector <std::size_t> >
305 const *
const tableFull =
nullptr)
const;
315 size_t const atomIndexOfR,
316 double const maxCutoffRadius,
317 std::vector<std::vector<size_t> >
318 const *
const tableFull =
nullptr)
const;
334 std::vector<std::string>
info()
const;
339 return !((*this) == rhs);
344 return rhs < (*this);
349 return !((*this) > rhs);
354 return !((*this) < rhs);
Struct to store information on neighbor atoms.
bool operator!=(Neighbor const &rhs) const
Overload != operator.
Neighbor()
Neighbor constructor, initialize to zero.
std::size_t index
Index of neighbor atom.
std::vector< double > cache
Symmetry function cache (e.g. for cutoffs, compact functions).
std::size_t element
Element index of neighbor atom.
double d
Distance to neighbor atom.
Vec3D dr
Distance vector to neighbor atom.
bool operator>=(Neighbor const &rhs) const
Overload >= operator.
bool operator==(Neighbor const &rhs) const
Overload == operator.
bool operator<=(Neighbor const &rhs) const
Overload <= operator.
int64_t tag
Tag of neighbor atom.
std::vector< std::string > info() const
Get atom information as a vector of strings.
std::vector< Vec3D > dGdr
Derivatives of symmetry functions with respect to neighbor coordinates.
bool operator<(Neighbor const &rhs) const
Overload < operator.
bool operator>(Neighbor const &rhs) const
Overload > operator.
Storage for a single atom.
std::vector< Neighbor > neighbors
Neighbor array (maximum number defined in macros.h.
std::vector< std::string > info() const
Get atom information as a vector of strings.
std::size_t numSymmetryFunctions
Number of symmetry functions used to describe the atom environment.
void clearNeighborList(std::size_t const numElements)
Clear neighbor list and change number of elements.
Vec3D r
Cartesian coordinates.
std::vector< double > dEdG
Derivative of atomic energy with respect to symmetry functions.
Vec3D calculateDChidr(size_t const atomIndexOfR, double const maxCutoffRadius, std::vector< std::vector< size_t > > const *const tableFull=nullptr) const
Calculate dChi/dr of this atom's Chi with respect to the coordinates of the given atom.
Vec3D f
Force vector calculated by neural network.
Vec3D calculatePairForceShort(Neighbor const &neighbor, std::vector< std::vector< std::size_t > > const *const tableFull=nullptr) const
Calculate force resulting from gradient of this atom's (short-ranged) energy contribution with respec...
bool hasSymmetryFunctionDerivatives
If symmetry function derivatives are saved for this atom.
std::vector< double > dQdG
Derivative of atomic charge with respect to symmetry functions.
double charge
Atomic charge determined by neural network.
bool isNeighbor(std::size_t index) const
Return whether atom is a neighbor.
std::size_t index
Index number of this atom.
Vec3D calculateSelfForceShort() const
Calculate force resulting from gradient of this atom's (short-ranged) energy contribution with respec...
std::size_t getStoredMinNumNeighbors(double const cutoffRadius) const
Return needed number of neighbors for a given cutoff radius from neighborCutoffs map.
std::vector< std::size_t > numSymmetryFunctionDerivatives
Number of neighbor atom symmetry function derivatives per element.
Vec3D fRef
Reference force vector from data set.
bool useChargeNeuron
If an additional charge neuron in the short-range NN is present.
std::vector< Vec3D > dGdr
Derivative of symmetry functions with respect to this atom's coordinates.
bool NeighborListIsSorted
If the neighbor list is sorted by distance.
double chi
Atomic electronegativity determined by neural network.
void toPhysicalUnits(double convEnergy, double convLength, double convCharge)
Switch to physical length, energy and charge units.
void clearNeighborList()
Clear neighbor list.
Vec3D fElec
Force vector resulting from electrostatics.
Vec3D pEelecpr
Partial derivative of electrostatic energy with respect to this atom's coordinates.
void free(bool all, double const maxCutoffRadius=0.0)
Free vectors related to symmetry functions, opposite of allocate().
std::size_t indexStructure
Index number of structure this atom belongs to.
std::vector< Vec3D > dAdrQ
If dQdr has been calculated for respective components.
int64_t tag
Tag number of this atom.
std::size_t element
Element index of this atom.
std::unordered_map< double, size_t > neighborCutoffs
Map stores number of neighbors needed for the corresponding cut-off.
void allocate(bool all, double const maxCutoffRadius=0.0)
Allocate vectors related to symmetry functions (G, dEdG).
void toNormalizedUnits(double convEnergy, double convLength, double convCharge)
Switch to normalized length, energy and charge units.
bool hasSymmetryFunctions
If symmetry function values are saved for this atom.
std::size_t calculateNumNeighbors(double const cutoffRadius) const
Calculate number of neighbors for a given cutoff radius.
void updateError(std::string const &property, std::map< std::string, double > &error, std::size_t &count) const
Update property error metrics with data from this atom.
std::vector< std::size_t > cacheSizePerElement
Cache size for each element.
Atom()
Atom constructor, initialize to zero.
bool hasNeighborList
If the neighbor list has been calculated for this atom.
std::vector< Vec3D > dQdr
Derivative of charges with respect to this atom's coordinates.
double dEelecdQ
Derivative of electrostatic energy with respect to this atom's charge.
double energy
Atomic energy determined by neural network.
std::vector< double > G
Symmetry function values.
std::vector< std::size_t > neighborsUnique
List of unique neighbor indices (don't count multiple PBC images).
double chargeRef
Atomic reference charge.
std::vector< std::size_t > numNeighborsPerElement
Number of neighbors per element.
std::vector< std::string > getForcesLines() const
Get reference and NN forces for this atoms.
std::string getChargeLine() const
Get reference and NN charge for this atoms.
std::size_t numNeighborsUnique
Number of unique neighbor indices (don't count multiple PBC images).
std::vector< double > dChidG
Derivative of electronegativity with respect to symmetry functions.
std::size_t numNeighbors
Total number of neighbors.
Vector in 3 dimensional real space.