Simpatico
v1.10
|
Cluster of molecules.
A Cluster is implemented as a linked list of ClusterLink objects, each of which is associated with a molecule. A Cluster has a pointer to the first ClusterLink and a size member that counts the number of links (or molecules), but does not own the associated ClusterLink or Molecule objects.
#include <Cluster.h>
Public Member Functions | |
Cluster () | |
Constructor. More... | |
~Cluster () | |
Destructor. More... | |
void | clear () |
Set cluster to empty. More... | |
void | setId (int id) |
Set cluster identifier. More... | |
void | addLink (ClusterLink &link) |
Add a link to the list. More... | |
int | id () const |
Get the cluster id. More... | |
int | size () const |
Get the number of molecules or links in the cluster. More... | |
ClusterLink * | head () const |
Get a pointer to the first link in the linked list. More... | |
bool | isValid () const |
Return true if valid, false otherwise. More... | |
Vector | clusterCOM (int atomTypeInCluster, Boundary const &boundary) |
Return the cluster COM. More... | |
Tensor | momentTensor (int atomTypeInCluster, Boundary const &boundary) |
Return the cluster radius of gyration tensor. More... | |
McMd::Cluster::Cluster | ( | ) |
Constructor.
Definition at line 16 of file Cluster.cpp.
McMd::Cluster::~Cluster | ( | ) |
Destructor.
Definition at line 22 of file Cluster.cpp.
void McMd::Cluster::clear | ( | ) |
Set cluster to empty.
Definition at line 25 of file Cluster.cpp.
References McMd::ClusterLink::clear(), and McMd::ClusterLink::next().
Referenced by McMd::ClusterIdentifier::identifyClusters().
void McMd::Cluster::setId | ( | int | id | ) |
Set cluster identifier.
Definition at line 39 of file Cluster.cpp.
References id(), McMd::ClusterLink::next(), and UTIL_THROW.
Referenced by McMd::ClusterIdentifier::identifyClusters().
void McMd::Cluster::addLink | ( | ClusterLink & | link | ) |
Add a link to the list.
link | ClusterLink associated with a Molecule. |
Definition at line 52 of file Cluster.cpp.
Referenced by McMd::ClusterIdentifier::identifyClusters(), and McMd::ClusterIdentifier::initialize().
|
inline |
Get the cluster id.
Definition at line 66 of file Cluster.h.
Referenced by McMd::ClusterIdentifier::initialize(), and setId().
|
inline |
Get the number of molecules or links in the cluster.
Definition at line 72 of file Cluster.h.
Referenced by McMd::ClusterHistogram::sample().
|
inline |
Get a pointer to the first link in the linked list.
Returns 0 pointer if cluster is empty.
Definition at line 80 of file Cluster.h.
References clusterCOM(), isValid(), and momentTensor().
Referenced by clusterCOM(), momentTensor(), and McMd::ClusterHistogram::sample().
bool McMd::Cluster::isValid | ( | ) | const |
Return true if valid, false otherwise.
Definition at line 60 of file Cluster.cpp.
References McMd::ClusterLink::clusterId(), and McMd::ClusterLink::next().
Referenced by head().
Return the cluster COM.
Definition at line 77 of file Cluster.cpp.
References McMd::Molecule::begin(), Simp::OrthorhombicBoundary::distanceSq(), head(), McMd::ClusterLink::molecule(), McMd::ClusterLink::next(), Util::ConstArrayIterator< Data >::notEnd(), Simp::OrthorhombicBoundary::shift(), and Util::Vector::zero().
Referenced by head(), momentTensor(), and McMd::ClusterHistogram::sample().
Return the cluster radius of gyration tensor.
Definition at line 111 of file Cluster.cpp.
References McMd::Molecule::begin(), clusterCOM(), Simp::OrthorhombicBoundary::distanceSq(), Util::Tensor::dyad(), head(), McMd::ClusterLink::molecule(), McMd::ClusterLink::next(), Util::ConstArrayIterator< Data >::notEnd(), and Util::Tensor::zero().
Referenced by head(), and McMd::ClusterHistogram::sample().