The main list of atoms class. More...
#include <Atoms.h>
Public Member Functions | |
| Atoms (const Vec *p, int n, SuperCell *s) | |
| Construct Atoms from array of positions, number of elements and a SuperCell. | |
| virtual | ~Atoms () |
| Deletes the atoms. Does not delete Potential or SuperCell. | |
| virtual SuperCell * | GetSuperCell () const |
| Return a pointer to the SuperCell object. | |
| virtual const Vec * | GetUnitCell () const |
| Return the unitcell vectors. | |
| virtual void | SetUnitCell (const Vec newbasis[3], bool fix) |
| Set a new unit cell, rescaling the positions unless fix is true. | |
| virtual void | SetCalculator (AsapPotential *potential) |
| Set a Potential. An eventual old Potential is not deallocated. | |
| AsapPotential * | GetPotential () const |
| Get a pointer to the Potential. | |
| void | MarkChanged () |
| Update the change pointer. | |
| int | GetChangeCounter () const |
| Get the change counter. | |
| virtual void | SetCartesianPositions (const Vec *p) |
| Set the Cartesian positions. | |
| virtual void | GetCartesianPositions (Vec *p) const |
| Return a copy of the Cartesian positions. | |
| virtual const Vec * | GetCartesianPositions () const |
| Return a const pointer to the Cartesian positions. | |
| Vec * | GetPositionsPtr () |
| Return a non-const pointer to the Cartesian positions. DANGEROUS! | |
| virtual void | GetUnwrappedPositions (vector< Vec > &p) const |
| Return the positions, hiding that they may have been wrapped due to the boundary conditions. | |
| virtual void | SetUnwrappedPositions (const Vec *p) |
| Set the positions from an array of positions not taking any wrapping into account. | |
| virtual void | NormalizeDifferences (Vec *diff) const |
| Apply periodic boundary conditions to differences in positions. | |
| virtual void | NormalizeDifference (Vec &diff) const |
| Apply periodic boundary conditions to difference in positions. | |
| virtual void | NormalizePositions () |
| Apply periodic boundary conditions to the positions. | |
| virtual void | NormalizePosition (Vec &pos) const |
| Normalize a position which is not owned by the atoms. | |
| virtual void | NormalizePosition (Vec &pos, Vec &scaled_translation) const |
| Normalize a position which is not owned by the atoms. | |
| virtual void | ReNormalizePosition (Vec &pos, Vec &scaled_translation) const |
| Repeat a normalization. See NormalizePosition(a,b). | |
| virtual void | SetAtomicNumbers (const int *z) |
| Set the atomic numbers. Should be done right after construction. | |
| virtual const int * | GetAtomicNumbers () const |
| Return a const pointer to the atomic numbers. | |
| int * | GetAtomicNumbersPtr () |
| Return a non-const pointer to the atomic numbers. DANGEROUS! | |
| virtual void | GetListOfElements (set< int > &elements) const |
| Get a set of all elements present in the simulations. | |
| void | SetNumberOfImages (int i) |
| Set the number of images. Used by the neighbor list. | |
| int | GetNumberOfImages () const |
| Get the number of images. Used by the neighbor list. | |
| virtual int | GetNumberOfAtoms () const |
| Get the number of atoms (including nodes in a QC simulation). | |
| int | GetNumberOfRealAtoms () const |
| Get the number of atoms (excluding nodes in a QC simulation). | |
| virtual void | SetNumberOfAtoms (int n) |
| Change the number of atoms. | |
Protected Attributes | |
| AsapPotential * | potential |
| A pointer to the potential. | |
| SuperCell * | superCell |
| A pointer to the supercell. | |
| vector< Vec > | positions |
| Contains the Cartesian positions. | |
| vector< Vec > | pos_translations |
| Translations applied to the positions to conform with the periodic boundary conditions. | |
| vector< int > | types |
| Contains the atomic numbers. | |
| int | nAtoms |
| The number of atoms in the list. | |
| int | nImages |
| The number of image atoms used by NeighborList. | |
| int | counter |
| Used to track changes. | |
The main list of atoms class.
The Atoms class stores the coordinates and atomic numbers of the atoms. Coordinates are stored as Cartesian coordinates. Atoms has a reference to a SuperCell object containing the unitcell of the simulation, and a pointer to a Potential object responsible of force calculations. Other information about atoms (such as velocities and forces) are not stored in the C++ code but live in Python.
|
inlinevirtual |
|
inlinevirtual |
|
inline |
|
inlinevirtual |
Return a const pointer to the Cartesian positions.
This version returns a pointer to the coordinates of all atoms. If ghost atoms are present, they are at the end of the array. It is up to the caller to know if ghost atoms are present, and to access them (or not) according to the need. Non-atomistic degrees of freedom, such as nodes in QC simulations, are not returned by this version.
Definition at line 100 of file Atoms.h.
|
virtual |
Return a copy of the Cartesian positions.
This version returns all degrees of freedom, i.e. both atoms and nodes in a quasicontinuum simulation. It does not return ghost atoms.
|
inline |
|
virtual |
Get a set of all elements present in the simulations.
|
inlinevirtual |
Get the number of atoms (including nodes in a QC simulation).
In a QuasiContinuum calculation we have real atoms and node atoms. GetNumberOfAtoms() is a virtual function: For a QCAtoms class it will return the number of real atoms plus the number of node atoms. This number is needed by SWIG to get the size of arrays. The method GetNumberOfRealAtoms() is needed by potentials and the Neighbor List object (they only deal with the real atoms).
Definition at line 190 of file Atoms.h.
|
inline |
|
inline |
Get the number of atoms (excluding nodes in a QC simulation).
See also the documentation of GetNumberOfAtoms().
Definition at line 196 of file Atoms.h.
|
inline |
|
inline |
|
inlinevirtual |
|
virtual |
Return the unitcell vectors.
Return the positions, hiding that they may have been wrapped due to the boundary conditions.
This is the function used by Python when GetCartesianPositions is called.
|
inline |
Update the change pointer.
The change counter is updated whenever the atoms are changed. It is used to decide if e.g. forces should be recalculated. Methods such as SetCartesianPositions() increment the counter.
Definition at line 65 of file Atoms.h.
|
virtual |
Apply periodic boundary conditions to difference in positions.
|
virtual |
Apply periodic boundary conditions to differences in positions.
|
virtual |
Normalize a position which is not owned by the atoms.
If another object holds a position needing to be normalized, this function should be called. It exists in two versions, one just normalizing the position, and one also returning the scaled space correction applied.
Normalize a position which is not owned by the atoms.
This version of the call reports the translation in scaled_translation, so the same translation can be obtained later (by calling ReNormalizePosition) without redoing the decision on whether to wrap. This is useful if positions need to be normalized between neighborlist updates, and is currently used by the Quasicontinuum code.
|
virtual |
Apply periodic boundary conditions to the positions.
Does NOT call MarkChanged ! Normalize the positions, i.e. translate the atoms back into the supercell if there are periodic boundary conditions. This does not count as changing the atoms, so the change counter is NOT updated. The actual work is done by the SuperCell. This method should be called by the Potential, which may (should?) delegate it to the NeighborList.
Repeat a normalization. See NormalizePosition(a,b).
|
virtual |
Set the atomic numbers. Should be done right after construction.
|
virtual |
|
virtual |
Set the Cartesian positions.
|
virtual |
Change the number of atoms.
| void Atoms::SetNumberOfImages | ( | int | i | ) |
Set the number of images. Used by the neighbor list.
|
virtual |
Set a new unit cell, rescaling the positions unless fix is true.
|
virtual |
Set the positions from an array of positions not taking any wrapping into account.
The already existing offset (caused by wrapping through periodic boundaries) is applied to the atoms. This is the function used by Python when SetCartesianPositions is called.
|
protected |
|
protected |
The number of image atoms used by NeighborList.
|
protected |
|
protected |
|
protected |