Simpatico  v1.10
ClusterHistogram.h
1 #ifndef MCMD_CLUSTER_HISTOGRAM_H
2 #define MCMD_CLUSTER_HISTOGRAM_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 <mcMd/analyzers/SystemAnalyzer.h> // base class templ
12 #include <mcMd/simulation/System.h> // class templ param
13 #include <mcMd/analyzers/system/ClusterIdentifier.h> // member
14 #include <util/accumulators/IntDistribution.h> // member
15 
16 namespace McMd
17 {
18 
19  using namespace Util;
20  using namespace Simp;
21 
25  class ClusterHistogram : public SystemAnalyzer<System>
26  {
27 
28  public:
29 
35  ClusterHistogram(System &system);
36 
50  virtual void readParameters(std::istream& in);
51 
55  virtual void setup();
56 
62  virtual void sample(long iStep);
63 
67  virtual void output();
68 
74  virtual void save(Serializable::OArchive& ar);
75 
81  virtual void loadParameters(Serializable::IArchive& ar);
82 
86  template <class Archive>
87  void serialize(Archive& ar, const unsigned int version);
88 
89  private:
90 
92  ClusterIdentifier identifier_;
93 
95  IntDistribution hist_;
96 
98  std::ofstream outputFile_;
99 
101  int speciesId_;
102 
104  int atomTypeId_;
105 
107  double cutoff_;
108 
110  int histMin_;
111 
113  int histMax_;
114 
116  long nSample_;
117 
119  bool isInitialized_;
120 
121  };
122 
126  template <class Archive>
127  void ClusterHistogram::serialize(Archive& ar, const unsigned int version)
128  {
129  Analyzer::serialize(ar, version);
130  ar & speciesId_;
131  ar & atomTypeId_;
132  ar & cutoff_;
133  ar & histMin_;
134  ar & histMax_;
135  ar & nSample_;
136  ar & hist_;
137  }
138 
139 }
140 #endif
A distribution (or histogram) of values for an int variable.
A set of interacting Molecules enclosed by a Boundary.
Definition: System.h:115
Identify micelle clusters in polymeric systems.
Classes used by all simpatico molecular simulations.
void serialize(Archive &ar, PairSelector &selector, const unsigned int version)
Serialize a PairSelector.
Definition: PairSelector.h:167
Saving / output archive for binary ostream.
void serialize(Archive &ar, const unsigned int version)
Serialize to/from an archive.
Utility classes for scientific computation.
Definition: accumulators.mod:1
Template for Analyzer associated with one System.
Saving archive for binary istream.
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
void serialize(Archive &ar, const unsigned int version)
Serialize to/from an archive.
Identifies clusters of molecules, such as micelles.