NetSci
Loading...
Searching...
No Matches
atoms.h
1//
2// Created by astokely on 5/4/23.
3//
4
5#ifndef NETSCI_ATOMS_H
6#define NETSCI_ATOMS_H
7
8
9#include "atom.h"
10#include <vector>
11#include <set>
12#include "nlohmann/json.hpp"
13
14
15class Atoms {
16public:
17 /**
18 * \brief Default constructor for Atoms.
19 *
20 * Constructs an empty Atoms object.
21 */
23
24 /**
25 * \brief Add an Atom to the Atoms collection.
26 *
27 * Adds the specified Atom to the collection of Atoms.
28 *
29 * \param atom Pointer to the Atom to add.
30 */
31 void addAtom(Atom* atom);
32
33 /**
34 * \brief Get the number of Atoms in the collection.
35 *
36 * Returns the number of Atoms in the collection.
37 *
38 * \return The number of Atoms.
39 *
40 * @PythonExample{NetChem_Atoms_numAtoms.py}
41 */
42 int numAtoms() const;
43
44 /**
45 * \brief Get the Atom with the specified index.
46 *
47 * Returns a pointer to the Atom with the specified index.
48 *
49 * \param atomIndex The index of the Atom.
50 * \return A pointer to the Atom with the specified index.
51 *
52 * @PythonExample{NetChem_Atoms_at.py}
53 */
54 Atom* at(int atomIndex);
55
56 /**
57 * \brief Get the number of unique Atom tags.
58 *
59 * Returns the number of unique Atom tags.
60 * Atoms with the same tag belong to the same Node.
61 *
62 * \return The number of unique Atom tags.
63 */
64 int numUniqueTags() const;
65
66 /**
67 * \brief Get a reference to the vector of Atoms.
68 *
69 * Returns a reference to the vector of Atoms.
70 *
71 * \return A reference to the vector of Atoms.
72 *
73 * @PythonExample{NetChem_Atoms_atoms.py}
74 */
75 std::vector<Atom*>& atoms();
76
77private:
78 friend nlohmann::adl_serializer<Atoms*>;
79 std::vector<Atom*> atoms_;
80 std::set<std::string> uniqueTags_;
81};
82
83
84#endif //NETSCI_ATOMS_H
85
Definition atom.h:12
Definition atoms.h:15
int numAtoms() const
Get the number of Atoms in the collection.
void addAtom(Atom *atom)
Add an Atom to the Atoms collection.
Atoms()
Default constructor for Atoms.
Atom * at(int atomIndex)
Get the Atom with the specified index.
int numUniqueTags() const
Get the number of unique Atom tags.
std::vector< Atom * > & atoms()
Get a reference to the vector of Atoms.