Simpatico
v1.10
|
A set of identical molecules.
Definition at line 27 of file tools/chemistry/Species.h.
#include <Species.h>
Public Member Functions | |
Species () | |
Constructor. More... | |
~Species () | |
Destructor. More... | |
void | setId (int id) |
Set the index for this species. More... | |
void | initialize (int nAtom, int capacity) |
Initialize memory for this species and set sizes. More... | |
void | addAtom (Atom &atom) |
Add an atom to the species. More... | |
void | clear () |
Clear all molecules, reset to empty. More... | |
void | begin (Iterator &iterator) |
Initialize an iterator over molecules. More... | |
Molecule & | molecule (int i) |
Return a specific molecule by reference. More... | |
int | id () const |
Return integer id for this species. More... | |
int | nAtom () const |
Return number of atoms per molecule. More... | |
int | size () const |
Return number of molecules in this species (=maximum id + 1) More... | |
int | capacity () const |
Return maximum number of molecules in this species. More... | |
bool | isValid () const |
Return true if valid, or throw Exception. More... | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Serialize to/from an archive. More... | |
Friends | |
std::istream & | operator>> (std::istream &in, Species &species) |
istream extractor (>>) for a Species. More... | |
std::ostream & | operator<< (std::ostream &out, const Species &species) |
ostream inserter (<<) for a Species. More... | |
Tools::Species::Species | ( | ) |
Constructor.
Tools::Species::~Species | ( | ) |
Destructor.
void Tools::Species::setId | ( | int | id | ) |
Set the index for this species.
id | species index |
void Tools::Species::initialize | ( | int | nAtom, |
int | capacity | ||
) |
Initialize memory for this species and set sizes.
nAtom | number of atoms per molecule (exact) |
capacity | maximum number of molecules in species |
Definition at line 36 of file tools/chemistry/Species.cpp.
References Simp::Species::capacity(), Simp::Species::nAtom(), Simp::Species::nAtom_, and UTIL_THROW.
void Tools::Species::addAtom | ( | Atom & | atom | ) |
Add an atom to the species.
atom | Atom object to be added, must have AtomContext info. |
Definition at line 105 of file tools/chemistry/Species.cpp.
References Tools::Atom::atomId, Simp::Species::id_, Tools::Atom::moleculeId, Simp::Species::nAtom_, Tools::Atom::speciesId, and UTIL_THROW.
void Tools::Species::clear | ( | ) |
Clear all molecules, reset to empty.
Definition at line 91 of file tools/chemistry/Species.cpp.
void Tools::Species::begin | ( | Iterator & | iterator | ) |
Initialize an iterator over molecules.
Definition at line 138 of file tools/chemistry/Species.cpp.
References Tools::Atom::atomId, Tools::Molecule::id(), Simp::Species::id_, Simp::Species::isValid(), Tools::Atom::moleculeId, Simp::Species::nAtom_, Tools::Atom::speciesId, and UTIL_THROW.
|
inline |
Return a specific molecule by reference.
i | molecule index |
Definition at line 185 of file tools/chemistry/Species.h.
References Simp::Species::id(), Simp::Species::id_, Simp::Species::nAtom(), and Simp::Species::nAtom_.
int Tools::Species::id | ( | ) | const |
Return integer id for this species.
int Tools::Species::nAtom | ( | ) | const |
Return number of atoms per molecule.
|
inline |
Return number of molecules in this species (=maximum id + 1)
Definition at line 203 of file tools/chemistry/Species.h.
References Simp::Species::capacity(), Simp::Species::nAtom_, and Util::ParamComponent::serialize().
int Tools::Species::capacity | ( | ) | const |
Return maximum number of molecules in this species.
bool Tools::Species::isValid | ( | ) | const |
Return true if valid, or throw Exception.
void Tools::Species::serialize | ( | Archive & | ar, |
const unsigned int | version | ||
) |
Serialize to/from an archive.
|
friend |
istream extractor (>>) for a Species.
in | input stream |
species | Species to be read from stream |
Definition at line 206 of file tools/chemistry/Species.cpp.
|
friend |
ostream inserter (<<) for a Species.
Format on one line with no line break:
out | output stream |
species | Species to be written to stream |
Definition at line 217 of file tools/chemistry/Species.cpp.