Simpatico  v1.10
TypeDistribution.h
1 #ifndef MCMD_TYPE_DISTRIBUTION_H
2 #define MCMD_TYPE_DISTRIBUTION_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 template
12 #include <mcMd/mcSimulation/McSystem.h> // base template parameter
13 #include <util/accumulators/IntDistribution.h> // member
14 
15 namespace Simp {
16  class Species;
17 }
18 
19 namespace McMd
20 {
21 
22  class SpeciesMutator;
23 
24  using namespace Util;
25  using namespace Simp;
26 
32  class TypeDistribution : public SystemAnalyzer<McSystem>
33  {
34 
35  public:
36 
40  TypeDistribution(McSystem& system);
41 
47  virtual void readParameters(std::istream& in);
48 
54  virtual void loadParameters(Serializable::IArchive& ar);
55 
61  virtual void save(Serializable::OArchive& ar);
62 
69  template <class Archive>
70  void serialize(Archive& ar, const unsigned int version);
71 
72  /*
73  * Evaluate energy and print.
74  */
75  void sample(long iStep);
76 
77  /*
78  * Output final summary and file format.
79  */
80  virtual void output();
81 
82  private:
83 
85  std::ofstream outputFile_;
86 
88  DArray<int> distribution_;
89 
91  int nSample_;
92 
94  int speciesId_;
95 
97  int nState_;
98 
100  Species* speciesPtr_;
101 
103  SpeciesMutator* mutatorPtr_;
104 
105  };
106 
107  /*
108  * Serialize to/from an archive.
109  */
110  template <class Archive>
111  void TypeDistribution::serialize(Archive& ar, const unsigned int version)
112  {
113  Analyzer::serialize(ar, version);
114  ar & speciesId_;
115  ar & nState_;
116  ar & nSample_;
117  ar & distribution_;
118  }
119 
120 }
121 #endif
void serialize(Archive &ar, BoundaryEnsemble::Type &data, const unsigned int version)
Serialize a BoundaryEnsemble::Type enum value.
A System for use in a Markov chain Monte Carlo simulation.
Definition: McSystem.h:52
Classes used by all simpatico molecular simulations.
Mix-in class for mutable subclasses of Species.
Saving / output archive for binary ostream.
Calculate distribution of type indices for mutable species.
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, T &data, const unsigned int version)
Serialize one object of type T.
Definition: serialize.h:29
A Species represents a set of chemically similar molecules.