Represents an atom in the simulation cell.
More...
#include <Atom.hpp>
Represents an atom in the simulation cell.
Compact 20-byte (float) / 32-byte (double) layout storing Cartesian position, unique ID, and a lock-free 16-bit ElementPool index. Velocities are stored lazily in Cell::velocities_.
◆ Atom() [1/3]
| correlation::core::Atom::Atom |
( |
| ) |
|
|
explicitdefaultnoexcept |
◆ Atom() [2/3]
Parameterized constructor.
- Parameters
-
| [in] | element | The element type of the atom. |
| [in] | pos | The position vector of the atom. |
| [in] | atom_id | The unique ID of the atom. |
◆ Atom() [3/3]
Pointer-based flyweight constructor.
- Parameters
-
| [in] | element_ptr | Pointer to the interned element. |
| [in] | pos | The position vector of the atom. |
| [in] | atom_id | The unique ID of the atom. |
◆ element()
| const Element & correlation::core::Atom::element |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
Gets the element type of the atom.
- Returns
- A const reference to the Element struct.
◆ elementId()
| std::int32_t correlation::core::Atom::elementId |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
Gets the integer ID of the element type.
- Returns
- The element ID value.
◆ id()
| AtomID correlation::core::Atom::id |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
Gets the unique ID of the atom.
- Returns
- The atom ID.
◆ position()
Gets the position of the atom.
- Returns
- A const reference to the position vector.
◆ setElement()
| void correlation::core::Atom::setElement |
( |
const Element & | ele | ) |
|
|
inline |
Sets the element type of the atom.
- Parameters
-
◆ setID()
| void correlation::core::Atom::setID |
( |
std::uint32_t | num | ) |
|
|
inlinenoexcept |
Sets the unique ID of the atom.
- Parameters
-
◆ setPosition()
Sets the position of the atom.
- Parameters
-
| [in] | pos | The new position vector. |
◆ element_id_
| std::int16_t correlation::core::Atom::element_id_ {-1} |
|
private |
Cached integer element ID (-1 if unassigned).
◆ element_pool_idx_
| std::uint16_t correlation::core::Atom::element_pool_idx_ {0} |
|
private |
◆ id_
| AtomID correlation::core::Atom::id_ {0} |
|
private |
Unique identification number.
◆ position_
Cartesian coordinates in Angstroms.
The documentation for this class was generated from the following file: