Simpatico  v1.10
BondLengthDist.h
1 #ifndef MCMD_BOND_LENGTH_DIST_H
2 #define MCMD_BOND_LENGTH_DIST_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/simulation/System.h> // base class template parameter
13 #include <util/accumulators/Distribution.h>
14 #include <util/containers/DArray.h>
15 
16 #include <util/global.h>
17 
18 namespace McMd
19 {
20 
21  using namespace Util;
22 
30  class BondLengthDist : public SystemAnalyzer<System>
31  {
32 
33  public:
34 
40  BondLengthDist(System &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 
75  virtual void setup();
76 
82  void sample(long iStep);
83 
87  virtual void output();
88 
89  private:
90 
91  // Output file stream
92  std::ofstream outputFile_;
93 
94  // Distribution statistical accumulator
95  Distribution accumulator_;
96 
98  double min_;
99 
101  double max_;
102 
104  double nBin_;
105 
107  int speciesId_;
108 
110  bool isInitialized_;
111 
112  };
113 
114  /*
115  * Serialize to/from an archive.
116  */
117  template <class Archive>
118  void BondLengthDist::serialize(Archive& ar, const unsigned int version)
119  {
120  Analyzer::serialize(ar, version);
121  ar & speciesId_;
122  ar & min_;
123  ar & max_;
124  ar & nBin_;
125  ar & accumulator_;
126  }
127 
128 }
129 #endif
A set of interacting Molecules enclosed by a Boundary.
Definition: System.h:115
File containing preprocessor macros for error handling.
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).
BondLengthDist evaluates the distribution function of the lengths of the bonds.
A distribution (or histogram) of values for a real variable.
Definition: Distribution.h:23
void serialize(Archive &ar, const unsigned int version)
Serialize to/from an archive.