n2p2 - A neural network potential package
nnp::Atom Struct Reference

Storage for a single atom. More...

#include <Atom.h>

Collaboration diagram for nnp::Atom:

Classes

struct  Neighbor
 Struct to store information on neighbor atoms. More...
 

Public Member Functions

 Atom ()
 Atom constructor, initialize to zero. More...
 
void toNormalizedUnits (double convEnergy, double convLength)
 Switch to normalized length and energy units. More...
 
void toPhysicalUnits (double convEnergy, double convLength)
 Switch to physical length and energy units. More...
 
void allocate (bool all)
 Allocate vectors related to symmetry functions (G, dEdG). More...
 
void free (bool all)
 Free vectors related to symmetry functions, opposite of allocate(). More...
 
void clearNeighborList ()
 Clear neighbor list. More...
 
void clearNeighborList (std::size_t const numElements)
 Clear neighbor list and change number of elements. More...
 
std::size_t getNumNeighbors (double cutoffRadius) const
 Calculate number of neighbors for a given cutoff radius. More...
 
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. More...
 
std::vector< std::string > getForcesLines () const
 Get reference and NN forces for this atoms. More...
 
std::string getChargeLine () const
 Get reference and NN charge for this atoms. More...
 
std::vector< std::string > info () const
 Get atom information as a vector of strings. More...
 

Public Attributes

bool hasNeighborList
 If the neighbor list has been calculated for this atom. More...
 
bool hasSymmetryFunctions
 If symmetry function values are saved for this atom. More...
 
bool hasSymmetryFunctionDerivatives
 If symmetry function derivatives are saved for this atom. More...
 
bool useChargeNeuron
 If an additional charge neuron in the short-range NN is present. More...
 
std::size_t index
 Index number of this atom. More...
 
std::size_t indexStructure
 Index number of structure this atom belongs to. More...
 
int64_t tag
 Tag number of this atom. More...
 
std::size_t element
 Element index of this atom. More...
 
std::size_t numNeighbors
 Total number of neighbors. More...
 
std::size_t numNeighborsUnique
 Number of unique neighbor indices (don't count multiple PBC images). More...
 
std::size_t numSymmetryFunctions
 Number of symmetry functions used to describe the atom environment. More...
 
double energy
 Atomic energy determined by neural network. More...
 
double charge
 Atomic charge determined by neural network. More...
 
double chargeRef
 Atomic reference charge. More...
 
Vec3D r
 Cartesian coordinates. More...
 
Vec3D f
 Force vector calculated by neural network. More...
 
Vec3D fRef
 Reference force vector from data set. More...
 
std::vector< std::size_t > neighborsUnique
 List of unique neighbor indices (don't count multiple PBC images). More...
 
std::vector< std::size_t > numNeighborsPerElement
 Number of neighbors per element. More...
 
std::vector< std::size_t > numSymmetryFunctionDerivatives
 Number of neighbor atom symmetry function derivatives per element. More...
 
std::vector< std::size_t > cacheSizePerElement
 Cache size for each element. More...
 
std::vector< double > G
 Symmetry function values. More...
 
std::vector< double > dEdG
 Derivative of atomic energy with respect to symmetry functions. More...
 
std::vector< double > dQdG
 Derivative of atomic charge with respect to symmetry functions. More...
 
std::vector< Vec3DdGdr
 Derivative of symmetry functions with respect to this atom's coordinates. More...
 
std::vector< Neighborneighbors
 Neighbor array (maximum number defined in macros.h. More...
 

Detailed Description

Storage for a single atom.

Definition at line 31 of file Atom.h.

Constructor & Destructor Documentation

◆ Atom()

Atom::Atom ( )

Atom constructor, initialize to zero.

Definition at line 27 of file Atom.cpp.

27 : hasNeighborList (false),
30 useChargeNeuron (false),
31 index (0 ),
32 indexStructure (0 ),
33 tag (0 ),
34 element (0 ),
35 numNeighbors (0 ),
38 energy (0.0 ),
39 charge (0.0 ),
40 chargeRef (0.0 )
41{
42}
std::size_t numSymmetryFunctions
Number of symmetry functions used to describe the atom environment.
Definition: Atom.h:110
bool hasSymmetryFunctionDerivatives
If symmetry function derivatives are saved for this atom.
Definition: Atom.h:94
double charge
Atomic charge determined by neural network.
Definition: Atom.h:114
std::size_t index
Index number of this atom.
Definition: Atom.h:98
bool useChargeNeuron
If an additional charge neuron in the short-range NN is present.
Definition: Atom.h:96
std::size_t indexStructure
Index number of structure this atom belongs to.
Definition: Atom.h:100
int64_t tag
Tag number of this atom.
Definition: Atom.h:102
std::size_t element
Element index of this atom.
Definition: Atom.h:104
bool hasSymmetryFunctions
If symmetry function values are saved for this atom.
Definition: Atom.h:92
bool hasNeighborList
If the neighbor list has been calculated for this atom.
Definition: Atom.h:90
double energy
Atomic energy determined by neural network.
Definition: Atom.h:112
double chargeRef
Atomic reference charge.
Definition: Atom.h:116
std::size_t numNeighborsUnique
Number of unique neighbor indices (don't count multiple PBC images).
Definition: Atom.h:108
std::size_t numNeighbors
Total number of neighbors.
Definition: Atom.h:106

Member Function Documentation

◆ toNormalizedUnits()

void Atom::toNormalizedUnits ( double  convEnergy,
double  convLength 
)

Switch to normalized length and energy units.

Parameters
[in]convEnergyMultiplicative energy unit conversion factor.
[in]convLengthMultiplicative length unit conversion factor.

Definition at line 73 of file Atom.cpp.

74{
75 energy *= convEnergy;
76 r *= convLength;
77 f *= convEnergy / convLength;
78 fRef *= convEnergy / convLength;
80 {
81 for (size_t i = 0; i < numSymmetryFunctions; ++i)
82 {
83 dEdG.at(i) *= convEnergy;
84 dGdr.at(i) /= convLength;
85#ifdef N2P2_FULL_SFD_MEMORY
86 dGdxia.at(i) /= convLength;
87#endif
88 }
89 // Take care of extra charge neuron.
90 if (useChargeNeuron) dEdG.at(numSymmetryFunctions) *= convEnergy;
91 }
92
94 {
95 for (vector<Neighbor>::iterator it = neighbors.begin();
96 it != neighbors.end(); ++it)
97 {
98 it->d *= convLength;
99 it->dr *= convLength;
101 {
102 for (size_t i = 0; i < dGdr.size(); ++i)
103 {
104 dGdr.at(i) /= convLength;
105 }
106 }
107 }
108 }
109
110 return;
111}
std::vector< Neighbor > neighbors
Neighbor array (maximum number defined in macros.h.
Definition: Atom.h:148
Vec3D r
Cartesian coordinates.
Definition: Atom.h:118
std::vector< double > dEdG
Derivative of atomic energy with respect to symmetry functions.
Definition: Atom.h:136
Vec3D f
Force vector calculated by neural network.
Definition: Atom.h:120
Vec3D fRef
Reference force vector from data set.
Definition: Atom.h:122
std::vector< Vec3D > dGdr
Derivative of symmetry functions with respect to this atom's coordinates.
Definition: Atom.h:146

References dEdG, dGdr, energy, f, fRef, hasNeighborList, hasSymmetryFunctionDerivatives, neighbors, numSymmetryFunctions, r, and useChargeNeuron.

◆ toPhysicalUnits()

void Atom::toPhysicalUnits ( double  convEnergy,
double  convLength 
)

Switch to physical length and energy units.

Parameters
[in]convEnergyMultiplicative energy unit conversion factor.
[in]convLengthMultiplicative length unit conversion factor.

Definition at line 113 of file Atom.cpp.

114{
115 energy /= convEnergy;
116 r /= convLength;
117 f /= convEnergy / convLength;
118 fRef /= convEnergy / convLength;
120 {
121 for (size_t i = 0; i < numSymmetryFunctions; ++i)
122 {
123 dEdG.at(i) /= convEnergy;
124 dGdr.at(i) *= convLength;
125#ifdef N2P2_FULL_SFD_MEMORY
126 dGdxia.at(i) *= convLength;
127#endif
128 }
129 // Take care of extra charge neuron.
130 if (useChargeNeuron) dEdG.at(numSymmetryFunctions) *= convEnergy;
131 }
132
133 if (hasNeighborList)
134 {
135 for (vector<Neighbor>::iterator it = neighbors.begin();
136 it != neighbors.end(); ++it)
137 {
138 it->d /= convLength;
139 it->dr /= convLength;
141 {
142 for (size_t i = 0; i < dGdr.size(); ++i)
143 {
144 dGdr.at(i) *= convLength;
145 }
146 }
147 }
148 }
149
150 return;
151}

References dEdG, dGdr, energy, f, fRef, hasNeighborList, hasSymmetryFunctionDerivatives, neighbors, numSymmetryFunctions, r, and useChargeNeuron.

◆ allocate()

void Atom::allocate ( bool  all)

Allocate vectors related to symmetry functions (G, dEdG).

Parameters
[in]allIf true allocate also vectors corresponding to derivatives of symmetry functions (dEdG, dGdr, #dGdxia and Neighbor::dGdr, neighbors must be present). If false allocate only G.

Warning: numSymmetryFunctions and numSymmetryFunctionDerivatives need to be set first (the latter only in case of argument all == true.

Definition at line 153 of file Atom.cpp.

154{
155 if (numSymmetryFunctions == 0)
156 {
157 throw range_error("ERROR: Number of symmetry functions set to"
158 "zero, cannot allocate.\n");
159 }
160
161 // Clear all symmetry function related vectors (also for derivatives).
162 G.clear();
163 dEdG.clear();
164 dQdG.clear();
165#ifdef N2P2_FULL_SFD_MEMORY
166 dGdxia.clear();
167#endif
168 dGdr.clear();
169 for (vector<Neighbor>::iterator it = neighbors.begin();
170 it != neighbors.end(); ++it)
171 {
172#ifndef N2P2_NO_SF_CACHE
173 it->cache.clear();
174#endif
175 it->dGdr.clear();
176 }
177
178 // Reset status of symmetry functions and derivatives.
179 hasSymmetryFunctions = false;
181
182 // Resize vectors (derivatives only if requested).
183 G.resize(numSymmetryFunctions, 0.0);
184 if (all)
185 {
186#ifndef N2P2_FULL_SFD_MEMORY
187 if (numSymmetryFunctionDerivatives.size() == 0)
188 {
189 throw range_error("ERROR: Number of symmetry function derivatives"
190 " unset, cannot allocate.\n");
191 }
192#endif
193 if (useChargeNeuron) dEdG.resize(numSymmetryFunctions + 1, 0.0);
194 else dEdG.resize(numSymmetryFunctions, 0.0);
195 dQdG.resize(numSymmetryFunctions, 0.0);
196#ifdef N2P2_FULL_SFD_MEMORY
197 dGdxia.resize(numSymmetryFunctions, 0.0);
198#endif
200 }
201 for (vector<Neighbor>::iterator it = neighbors.begin();
202 it != neighbors.end(); ++it)
203 {
204#ifndef N2P2_NO_SF_CACHE
205 it->cache.resize(cacheSizePerElement.at(it->element),
206 -numeric_limits<double>::max());
207#endif
208 if (all)
209 {
210#ifndef N2P2_FULL_SFD_MEMORY
211 it->dGdr.resize(numSymmetryFunctionDerivatives.at(it->element));
212#else
213 it->dGdr.resize(numSymmetryFunctions);
214#endif
215 }
216 }
217
218 return;
219}
std::vector< double > dQdG
Derivative of atomic charge with respect to symmetry functions.
Definition: Atom.h:138
std::vector< std::size_t > numSymmetryFunctionDerivatives
Number of neighbor atom symmetry function derivatives per element.
Definition: Atom.h:128
std::vector< std::size_t > cacheSizePerElement
Cache size for each element.
Definition: Atom.h:131
std::vector< double > G
Symmetry function values.
Definition: Atom.h:134

References cacheSizePerElement, dEdG, dGdr, dQdG, G, hasSymmetryFunctionDerivatives, hasSymmetryFunctions, neighbors, numSymmetryFunctionDerivatives, numSymmetryFunctions, and useChargeNeuron.

Referenced by nnp::Mode::calculateSymmetryFunctionGroups(), and nnp::Mode::calculateSymmetryFunctions().

Here is the caller graph for this function:

◆ free()

void Atom::free ( bool  all)

Free vectors related to symmetry functions, opposite of allocate().

Parameters
[in]allIf true free all vectors (G, dEdG, dGdr, #dGdxia and Neighbor::dGdr) otherwise free only dEdG, dGdr, #dGdxia and Neighbor::dGdr.

Definition at line 221 of file Atom.cpp.

222{
223 if (all)
224 {
225 G.clear();
226 vector<double>(G).swap(G);
227 hasSymmetryFunctions = false;
228#ifndef N2P2_NO_SF_CACHE
229 for (vector<Neighbor>::iterator it = neighbors.begin();
230 it != neighbors.end(); ++it)
231 {
232 it->cache.clear();
233 vector<double>(it->cache).swap(it->cache);
234 }
235#endif
236 }
237
238 dEdG.clear();
239 vector<double>(dEdG).swap(dEdG);
240 dQdG.clear();
241 vector<double>(dQdG).swap(dQdG);
242#ifdef N2P2_FULL_SFD_MEMORY
243 dGdxia.clear();
244 vector<double>(dGdxia).swap(dGdxia);
245#endif
246 dGdr.clear();
247 vector<Vec3D>(dGdr).swap(dGdr);
248 for (vector<Neighbor>::iterator it = neighbors.begin();
249 it != neighbors.end(); ++it)
250 {
251 it->dGdr.clear();
252 vector<Vec3D>(it->dGdr).swap(it->dGdr);
253 }
255
256 return;
257}

References dEdG, dGdr, dQdG, G, hasSymmetryFunctionDerivatives, hasSymmetryFunctions, and neighbors.

◆ clearNeighborList() [1/2]

void Atom::clearNeighborList ( )

Clear neighbor list.

Note
Also clears symmetry function data.

Definition at line 259 of file Atom.cpp.

260{
262
263 return;
264}
void clearNeighborList()
Clear neighbor list.
Definition: Atom.cpp:259
std::vector< std::size_t > numNeighborsPerElement
Number of neighbors per element.
Definition: Atom.h:126

References clearNeighborList(), and numNeighborsPerElement.

Referenced by clearNeighborList(), and nnp::Structure::clearNeighborList().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clearNeighborList() [2/2]

void nnp::Atom::clearNeighborList ( std::size_t const  numElements)

Clear neighbor list and change number of elements.

Parameters
[in]numElementsNumber of elements present.
Note
Also clears symmetry function data. The number of elements is necessary to allocate the numNeighborsPerElement vector. Use the overloaded version clearNeighborList() if the number of elements stays the same.

◆ getNumNeighbors()

size_t Atom::getNumNeighbors ( double  cutoffRadius) const

Calculate number of neighbors for a given cutoff radius.

Parameters
[in]cutoffRadiusDesired cutoff radius.

This function assumes that the neighbor list has already been calculated for a large cutoff radius and now the number of neighbor atoms for a smaller cutoff is requested.

Definition at line 281 of file Atom.cpp.

282{
283 size_t numNeighborsLocal = 0;
284
285 for (vector<Neighbor>::const_iterator it = neighbors.begin();
286 it != neighbors.end(); ++it)
287 {
288 if (it->d <= cutoffRadius)
289 {
290 numNeighborsLocal++;
291 }
292 }
293
294 return numNeighborsLocal;
295}

References neighbors.

Referenced by nnp::Mode::calculateSymmetryFunctionGroups(), and nnp::Mode::calculateSymmetryFunctions().

Here is the caller graph for this function:

◆ updateError()

void Atom::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.

Parameters
[in]propertyOne of "force" or "charge".
[in,out]errorInput error metric map to be updated.
[in,out]countInput counter to be updated.

Definition at line 297 of file Atom.cpp.

300{
301 if (property == "force")
302 {
303 count += 3;
304 error.at("RMSE") += (fRef - f).norm2();
305 error.at("MAE") += (fRef - f).l1norm();
306 }
307 else if (property == "charge")
308 {
309 count++;
310 error.at("RMSE") += (chargeRef - charge) * (chargeRef - charge);
311 error.at("MAE") += fabs(chargeRef - charge);
312 }
313 else
314 {
315 throw runtime_error("ERROR: Unknown property for error update.\n");
316 }
317
318 return;
319}

References charge, chargeRef, f, and fRef.

◆ getForcesLines()

vector< string > Atom::getForcesLines ( ) const

Get reference and NN forces for this atoms.

Returns
Vector of strings with indexStructure, index, fRef, f values.

Definition at line 321 of file Atom.cpp.

322{
323 vector<string> v;
324 for (size_t i = 0; i < 3; ++i)
325 {
326 v.push_back(strpr("%10zu %10zu %16.8E %16.8E\n",
328 index,
329 fRef[i],
330 f[i]));
331 }
332
333 return v;
334}
string strpr(const char *format,...)
String version of printf function.
Definition: utility.cpp:90

References f, fRef, index, indexStructure, and nnp::strpr().

Here is the call graph for this function:

◆ getChargeLine()

string Atom::getChargeLine ( ) const

Get reference and NN charge for this atoms.

Returns
Line with indexStructure, index, chargeRef, charge values.

Definition at line 336 of file Atom.cpp.

337{
338 return strpr("%10zu %10zu %16.8E %16.8E\n",
340 index,
341 chargeRef,
342 charge);
343}

References charge, chargeRef, index, indexStructure, and nnp::strpr().

Here is the call graph for this function:

◆ info()

vector< string > Atom::info ( ) const

Get atom information as a vector of strings.

Returns
Lines with atom information.

Definition at line 345 of file Atom.cpp.

346{
347 vector<string> v;
348
349 v.push_back(strpr("********************************\n"));
350 v.push_back(strpr("ATOM \n"));
351 v.push_back(strpr("********************************\n"));
352 v.push_back(strpr("hasNeighborList : %d\n", hasNeighborList));
353 v.push_back(strpr("hasSymmetryFunctions : %d\n", hasSymmetryFunctions));
354 v.push_back(strpr("hasSymmetryFunctionDerivatives : %d\n", hasSymmetryFunctionDerivatives));
355 v.push_back(strpr("useChargeNeuron : %d\n", useChargeNeuron));
356 v.push_back(strpr("index : %d\n", index));
357 v.push_back(strpr("indexStructure : %d\n", indexStructure));
358 v.push_back(strpr("tag : %" PRId64 "\n", tag));
359 v.push_back(strpr("element : %d\n", element));
360 v.push_back(strpr("numNeighbors : %d\n", numNeighbors));
361 v.push_back(strpr("numNeighborsUnique : %d\n", numNeighborsUnique));
362 v.push_back(strpr("numSymmetryFunctions : %d\n", numSymmetryFunctions));
363 v.push_back(strpr("energy : %16.8E\n", energy));
364 v.push_back(strpr("charge : %16.8E\n", charge));
365 v.push_back(strpr("chargeRef : %16.8E\n", chargeRef));
366 v.push_back(strpr("r : %16.8E %16.8E %16.8E\n", r[0], r[1], r[2]));
367 v.push_back(strpr("f : %16.8E %16.8E %16.8E\n", f[0], f[1], f[2]));
368 v.push_back(strpr("fRef : %16.8E %16.8E %16.8E\n", fRef[0], fRef[1], fRef[2]));
369 v.push_back(strpr("--------------------------------\n"));
370 v.push_back(strpr("neighborsUnique [*] : %d\n", neighborsUnique.size()));
371 v.push_back(strpr("--------------------------------\n"));
372 for (size_t i = 0; i < neighborsUnique.size(); ++i)
373 {
374 v.push_back(strpr("%29d : %d\n", i, neighborsUnique.at(i)));
375 }
376 v.push_back(strpr("--------------------------------\n"));
377 v.push_back(strpr("--------------------------------\n"));
378 v.push_back(strpr("numNeighborsPerElement [*] : %d\n", numNeighborsPerElement.size()));
379 v.push_back(strpr("--------------------------------\n"));
380 for (size_t i = 0; i < numNeighborsPerElement.size(); ++i)
381 {
382 v.push_back(strpr("%29d : %d\n", i, numNeighborsPerElement.at(i)));
383 }
384 v.push_back(strpr("--------------------------------\n"));
385 v.push_back(strpr("--------------------------------\n"));
386 v.push_back(strpr("numSymmetryFunctionDeriv. [*] : %d\n", numSymmetryFunctionDerivatives.size()));
387 v.push_back(strpr("--------------------------------\n"));
388 for (size_t i = 0; i < numSymmetryFunctionDerivatives.size(); ++i)
389 {
390 v.push_back(strpr("%29d : %d\n", i, numSymmetryFunctionDerivatives.at(i)));
391 }
392#ifndef N2P2_NO_SF_CACHE
393 v.push_back(strpr("--------------------------------\n"));
394 v.push_back(strpr("--------------------------------\n"));
395 v.push_back(strpr("cacheSizePerElement [*] : %d\n", cacheSizePerElement.size()));
396 v.push_back(strpr("--------------------------------\n"));
397 for (size_t i = 0; i < cacheSizePerElement.size(); ++i)
398 {
399 v.push_back(strpr("%29d : %d\n", i, cacheSizePerElement.at(i)));
400 }
401#endif
402 v.push_back(strpr("--------------------------------\n"));
403 v.push_back(strpr("--------------------------------\n"));
404 v.push_back(strpr("G [*] : %d\n", G.size()));
405 v.push_back(strpr("--------------------------------\n"));
406 for (size_t i = 0; i < G.size(); ++i)
407 {
408 v.push_back(strpr("%29d : %16.8E\n", i, G.at(i)));
409 }
410 v.push_back(strpr("--------------------------------\n"));
411 v.push_back(strpr("--------------------------------\n"));
412 v.push_back(strpr("dEdG [*] : %d\n", dEdG.size()));
413 v.push_back(strpr("--------------------------------\n"));
414 for (size_t i = 0; i < dEdG.size(); ++i)
415 {
416 v.push_back(strpr("%29d : %16.8E\n", i, dEdG.at(i)));
417 }
418 v.push_back(strpr("--------------------------------\n"));
419 v.push_back(strpr("--------------------------------\n"));
420 v.push_back(strpr("dQdG [*] : %d\n", dQdG.size()));
421 v.push_back(strpr("--------------------------------\n"));
422 for (size_t i = 0; i < dQdG.size(); ++i)
423 {
424 v.push_back(strpr("%29d : %16.8E\n", i, dQdG.at(i)));
425 }
426 v.push_back(strpr("--------------------------------\n"));
427#ifdef N2P2_FULL_SFD_MEMORY
428 v.push_back(strpr("--------------------------------\n"));
429 v.push_back(strpr("dGdxia [*] : %d\n", dGdxia.size()));
430 v.push_back(strpr("--------------------------------\n"));
431 for (size_t i = 0; i < dGdxia.size(); ++i)
432 {
433 v.push_back(strpr("%29d : %16.8E\n", i, dGdxia.at(i)));
434 }
435 v.push_back(strpr("--------------------------------\n"));
436#endif
437 v.push_back(strpr("--------------------------------\n"));
438 v.push_back(strpr("dGdr [*] : %d\n", dGdr.size()));
439 v.push_back(strpr("--------------------------------\n"));
440 for (size_t i = 0; i < dGdr.size(); ++i)
441 {
442 v.push_back(strpr("%29d : %16.8E %16.8E %16.8E\n", i, dGdr.at(i)[0], dGdr.at(i)[1], dGdr.at(i)[2]));
443 }
444 v.push_back(strpr("--------------------------------\n"));
445 v.push_back(strpr("--------------------------------\n"));
446 v.push_back(strpr("neighbors [*] : %d\n", neighbors.size()));
447 v.push_back(strpr("--------------------------------\n"));
448 for (size_t i = 0; i < neighbors.size(); ++i)
449 {
450 v.push_back(strpr("%29d :\n", i));
451 vector<string> vn = neighbors[i].info();
452 v.insert(v.end(), vn.begin(), vn.end());
453 }
454 v.push_back(strpr("--------------------------------\n"));
455 v.push_back(strpr("********************************\n"));
456
457 return v;
458}
std::vector< std::size_t > neighborsUnique
List of unique neighbor indices (don't count multiple PBC images).
Definition: Atom.h:124

References cacheSizePerElement, charge, chargeRef, dEdG, dGdr, dQdG, element, energy, f, fRef, G, hasNeighborList, hasSymmetryFunctionDerivatives, hasSymmetryFunctions, index, indexStructure, neighbors, neighborsUnique, numNeighbors, numNeighborsPerElement, numNeighborsUnique, numSymmetryFunctionDerivatives, numSymmetryFunctions, r, nnp::strpr(), tag, and useChargeNeuron.

Here is the call graph for this function:

Member Data Documentation

◆ hasNeighborList

bool nnp::Atom::hasNeighborList

If the neighbor list has been calculated for this atom.

Definition at line 90 of file Atom.h.

Referenced by info(), toNormalizedUnits(), and toPhysicalUnits().

◆ hasSymmetryFunctions

bool nnp::Atom::hasSymmetryFunctions

If symmetry function values are saved for this atom.

Definition at line 92 of file Atom.h.

Referenced by allocate(), nnp::Mode::calculateSymmetryFunctionGroups(), nnp::Mode::calculateSymmetryFunctions(), free(), info(), and nnp::InterfaceLammps::setLocalAtoms().

◆ hasSymmetryFunctionDerivatives

bool nnp::Atom::hasSymmetryFunctionDerivatives

◆ useChargeNeuron

bool nnp::Atom::useChargeNeuron

If an additional charge neuron in the short-range NN is present.

Definition at line 96 of file Atom.h.

Referenced by allocate(), nnp::Mode::calculateSymmetryFunctionGroups(), nnp::Mode::calculateSymmetryFunctions(), info(), toNormalizedUnits(), and toPhysicalUnits().

◆ index

◆ indexStructure

std::size_t nnp::Atom::indexStructure

◆ tag

int64_t nnp::Atom::tag

Tag number of this atom.

Definition at line 102 of file Atom.h.

Referenced by nnp::Atom::Neighbor::info(), info(), and nnp::Element::updateSymmetryFunctionStatistics().

◆ element

◆ numNeighbors

◆ numNeighborsUnique

std::size_t nnp::Atom::numNeighborsUnique

Number of unique neighbor indices (don't count multiple PBC images).

Definition at line 108 of file Atom.h.

Referenced by info().

◆ numSymmetryFunctions

◆ energy

double nnp::Atom::energy

Atomic energy determined by neural network.

Definition at line 112 of file Atom.h.

Referenced by nnp::InterfaceLammps::getAtomicEnergy(), info(), toNormalizedUnits(), and toPhysicalUnits().

◆ charge

double nnp::Atom::charge

Atomic charge determined by neural network.

Definition at line 114 of file Atom.h.

Referenced by getChargeLine(), info(), nnp::Training::sortUpdateCandidates(), nnp::Training::update(), and updateError().

◆ chargeRef

double nnp::Atom::chargeRef

Atomic reference charge.

Definition at line 116 of file Atom.h.

Referenced by getChargeLine(), info(), nnp::Training::sortUpdateCandidates(), nnp::Training::update(), and updateError().

◆ r

Vec3D nnp::Atom::r

Cartesian coordinates.

Definition at line 118 of file Atom.h.

Referenced by info(), nnp::Structure::remap(), toNormalizedUnits(), and toPhysicalUnits().

◆ f

Vec3D nnp::Atom::f

◆ fRef

Vec3D nnp::Atom::fRef

Reference force vector from data set.

Definition at line 122 of file Atom.h.

Referenced by getForcesLines(), info(), main(), nnp::Training::sortUpdateCandidates(), toNormalizedUnits(), toPhysicalUnits(), nnp::Training::update(), and updateError().

◆ neighborsUnique

std::vector<std::size_t> nnp::Atom::neighborsUnique

List of unique neighbor indices (don't count multiple PBC images).

Definition at line 124 of file Atom.h.

Referenced by nnp::Mode::calculateForces(), and info().

◆ numNeighborsPerElement

std::vector<std::size_t> nnp::Atom::numNeighborsPerElement

◆ numSymmetryFunctionDerivatives

std::vector<std::size_t> nnp::Atom::numSymmetryFunctionDerivatives

Number of neighbor atom symmetry function derivatives per element.

Definition at line 128 of file Atom.h.

Referenced by allocate(), nnp::Mode::calculateSymmetryFunctionGroups(), nnp::Mode::calculateSymmetryFunctions(), and info().

◆ cacheSizePerElement

std::vector<std::size_t> nnp::Atom::cacheSizePerElement

Cache size for each element.

Definition at line 131 of file Atom.h.

Referenced by allocate(), nnp::Mode::calculateSymmetryFunctionGroups(), nnp::Mode::calculateSymmetryFunctions(), and info().

◆ G

◆ dEdG

std::vector<double> nnp::Atom::dEdG

Derivative of atomic energy with respect to symmetry functions.

Definition at line 136 of file Atom.h.

Referenced by allocate(), nnp::Mode::calculateForces(), free(), nnp::InterfaceLammps::getForces(), info(), toNormalizedUnits(), and toPhysicalUnits().

◆ dQdG

std::vector<double> nnp::Atom::dQdG

Derivative of atomic charge with respect to symmetry functions.

Definition at line 138 of file Atom.h.

Referenced by allocate(), free(), and info().

◆ dGdr

◆ neighbors


The documentation for this struct was generated from the following files: