Simpatico  v1.10
List of all members | Public Member Functions
McMd::Cluster Class Reference

Detailed Description

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.

Definition at line 31 of file Cluster.h.

#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...
 

Constructor & Destructor Documentation

McMd::Cluster::Cluster ( )

Constructor.

Definition at line 16 of file Cluster.cpp.

McMd::Cluster::~Cluster ( )

Destructor.

Definition at line 22 of file Cluster.cpp.

Member Function Documentation

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.

Parameters
linkClusterLink associated with a Molecule.

Definition at line 52 of file Cluster.cpp.

Referenced by McMd::ClusterIdentifier::identifyClusters(), and McMd::ClusterIdentifier::initialize().

int McMd::Cluster::id ( ) const
inline

Get the cluster id.

Definition at line 66 of file Cluster.h.

Referenced by McMd::ClusterIdentifier::initialize(), and setId().

int McMd::Cluster::size ( ) const
inline

Get the number of molecules or links in the cluster.

Definition at line 72 of file Cluster.h.

Referenced by McMd::ClusterHistogram::sample().

ClusterLink* McMd::Cluster::head ( ) const
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().

Vector McMd::Cluster::clusterCOM ( int  atomTypeInCluster,
Boundary const &  boundary 
)
Tensor McMd::Cluster::momentTensor ( int  atomTypeInCluster,
Boundary const &  boundary 
)

The documentation for this class was generated from the following files: