Simpatico  v1.10
IntraPairAutoCorr.h
1 #ifndef MCMD_INTRA_PAIR_AUTO_CORR_H
2 #define MCMD_INTRA_PAIR_AUTO_CORR_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/AutoCorrArray.h> // base class template parameter
14 #include <util/space/Vector.h> // template parameter
15 #include <util/containers/DArray.h> // member template
16 
17 namespace Simp {
18  class Species;
19 }
20 
21 namespace McMd
22 {
23 
24  using namespace Util;
25  using namespace Simp;
26 
52  : public SystemAnalyzer<System>
53  {
54 
55  public:
56 
62  IntraPairAutoCorr(System &system);
63 
78  virtual void readParameters(std::istream& in);
79 
85  virtual void loadParameters(Serializable::IArchive& ar);
86 
92  virtual void save(Serializable::OArchive& ar);
93 
100  template <class Archive>
101  void serialize(Archive& ar, const unsigned int version);
102 
106  virtual void setup();
107 
113  virtual void sample(long iStep);
114 
118  virtual void output();
119 
120  private:
121 
123  std::ofstream outputFile_;
124 
126  AutoCorrArray<Vector, double> accumulator_;
127 
129  DArray<Vector> data_;
130 
132  Species *speciesPtr_;
133 
135  int speciesId_;
136 
138  int nMolecule_;
139 
141  int atom1Id_;
142 
144  int atom2Id_;
145 
147  int capacity_;
148 
150  bool isInitialized_;
151 
152  };
153 
154  /*
155  * Serialize to/from an archive.
156  */
157  template <class Archive>
158  void IntraPairAutoCorr::serialize(Archive& ar, const unsigned int version)
159  {
160  Analyzer::serialize(ar, version);
161  ar & speciesId_;
162  ar & atom1Id_;
163  ar & atom2Id_;
164  ar & capacity_;
165 
166  ar & nMolecule_;
167  ar & accumulator_;
168  }
169 
170 }
171 #endif
void serialize(Archive &ar, BoundaryEnsemble::Type &data, const unsigned int version)
Serialize a BoundaryEnsemble::Type enum value.
Autocorrelation for vector separation of any two monomers on a molecule.
A set of interacting Molecules enclosed by a Boundary.
Definition: System.h:115
Classes used by all simpatico molecular simulations.
Saving / output archive for binary ostream.
Auto-correlation function for an ensemble of sequences.
Definition: AutoCorrArray.h:57
Utility classes for scientific computation.
Definition: accumulators.mod:1
Template for Analyzer associated with one System.
Dynamically allocatable contiguous array template.
Definition: DArray.h:31
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.