Simpatico  v1.10
Cluster.h
1 #ifndef MCMD_CLUSTER_H
2 #define MCMD_CLUSTER_H
3 
4 /*
5 * Simpatico - Simulation Package for Polymeric and Molecular Liquids
6 *
7 * Copyright 2010 - 2017, The Regents of the University of Minnesota
8 * Distributed under the terms of the GNU General Public License.
9 */
10 
11 #include "ClusterLink.h"
12 #include <util/space/Tensor.h>
13 #include <util/space/Vector.h>
14 #include <util/global.h>
15 #include <mcMd/simulation/System.h> // base class templ param
16 
17 namespace McMd
18 {
19  class System;
20 
31  class Cluster
32  {
33 
34  public:
35 
39  Cluster();
40 
44  ~Cluster();
45 
49  void clear();
50 
54  void setId(int id);
55 
61  void addLink(ClusterLink& link);
62 
66  int id() const
67  { return id_; }
68 
72  int size() const
73  { return size_; }
74 
80  ClusterLink* head() const
81  { return head_; }
82 
86  bool isValid() const;
87 
91  Vector clusterCOM( int atomTypeInCluster, Boundary const & boundary);
92 
96  Tensor momentTensor(int atomTypeInCluster, Boundary const & boundary);
97 
98  private:
99 
100  // Integer identifier for this cluster.
101  int id_;
102 
103  // Number of molecules (or links) in this cluster.
104  int size_;
105 
106  // Pointer to first link in singly-linked list.
107  ClusterLink* head_;
108 
109  };
110 
111 }
112 #endif
A Vector is a Cartesian vector.
Definition: Vector.h:75
An orthorhombic periodic unit cell.
bool isValid() const
Return true if valid, false otherwise.
Definition: Cluster.cpp:60
void clear()
Set cluster to empty.
Definition: Cluster.cpp:25
File containing preprocessor macros for error handling.
Cluster()
Constructor.
Definition: Cluster.cpp:16
A Tensor represents a Cartesian tensor.
Definition: Tensor.h:32
ClusterLink * head() const
Get a pointer to the first link in the linked list.
Definition: Cluster.h:80
int id() const
Get the cluster id.
Definition: Cluster.h:66
~Cluster()
Destructor.
Definition: Cluster.cpp:22
int size() const
Get the number of molecules or links in the cluster.
Definition: Cluster.h:72
Cluster of molecules.
Definition: Cluster.h:31
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
void setId(int id)
Set cluster identifier.
Definition: Cluster.cpp:39
Vector clusterCOM(int atomTypeInCluster, Boundary const &boundary)
Return the cluster COM.
Definition: Cluster.cpp:77
Tensor momentTensor(int atomTypeInCluster, Boundary const &boundary)
Return the cluster radius of gyration tensor.
Definition: Cluster.cpp:111
void addLink(ClusterLink &link)
Add a link to the list.
Definition: Cluster.cpp:52