Simpatico  v1.10
SemiGrandDistribution.h
1 #ifndef MCMD_SEMI_GRAND_DISTRIBUTION_H
2 #define MCMD_SEMI_GRAND_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 SemiGrandDistribution : public SystemAnalyzer<McSystem>
33  {
34 
35  public:
36 
41 
45  virtual void readParameters(std::istream& in);
46 
52  virtual void loadParameters(Serializable::IArchive& ar);
53 
59  virtual void save(Serializable::OArchive& ar);
60 
67  template <class Archive>
68  void serialize(Archive& ar, const unsigned int version);
69 
73  void sample(long iStep);
74 
78  virtual void output();
79 
80  private:
81 
83  std::ofstream outputFile_;
84 
86  IntDistribution distribution_;
87 
89  int speciesId_;
90 
92  int moleculeCapacity_;
93 
95  Species* speciesPtr_;
96 
98  SpeciesMutator* mutatorPtr_;
99 
100  };
101 
102  /*
103  * Serialize to/from an archive.
104  */
105  template <class Archive>
106  void SemiGrandDistribution::serialize(Archive& ar, const unsigned int version)
107  {
108  Analyzer::serialize(ar, version);
109  ar & speciesId_;
110  ar & moleculeCapacity_;
111  ar & distribution_;
112  }
113 
114 }
115 #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
A distribution (or histogram) of values for an int variable.
Classes used by all simpatico molecular simulations.
Mix-in class for mutable subclasses of Species.
Saving / output archive for binary ostream.
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.
Calculate distribution of type indices for mutable species.