Simpatico  v1.10
IntraBondStressAutoCorr.h
1 #ifndef MCMD_INTRA_BOND_STRESS_AUTO_CORR_H
2 #define MCMD_INTRA_BOND_STRESS_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 <util/accumulators/AutoCorrArray.h> // member template
13 #include <util/space/Tensor.h> // member template parameter
14 #include <util/containers/DArray.h> // member template
15 
16 #include <util/archives/serialize.h> // used in method template
17 #include <util/global.h> // used in method template
18 
19 namespace Simp {
20  class Species;
21 }
22 
23 namespace McMd
24 {
25 
26  using namespace Util;
27  using namespace Simp;
28 
34  template <class SystemType>
35  class IntraBondStressAutoCorr : public SystemAnalyzer<SystemType>
36  {
37 
38  public:
39 
45  IntraBondStressAutoCorr(SystemType &system);
46 
50  virtual ~IntraBondStressAutoCorr();
51 
57  virtual void readParameters(std::istream& in);
58 
64  virtual void loadParameters(Serializable::IArchive &ar);
65 
71  virtual void save(Serializable::OArchive &ar);
72 
79  template <class Archive>
80  void serialize(Archive& ar, const unsigned int version);
81 
85  virtual void setup();
86 
92  virtual void sample(long iStep);
93 
97  virtual void output();
98 
99  protected:
100 
110 
111  private:
112 
114  std::ofstream outputFile_;
115 
117  AutoCorrArray<Tensor, double> accumulator_;
118 
120  DArray<Tensor> data_;
121 
123  Species* speciesPtr_;
124 
126  int speciesId_;
127 
129  int nMolecule_;
130 
132  int nBond_;
133 
135  int capacity_;
136 
138  bool isInitialized_;
139 
140  };
141 
142  /*
143  * Serialize to/from an archive.
144  */
145  template <class SystemType>
146  template <class Archive>
147  void IntraBondStressAutoCorr<SystemType>::serialize(Archive& ar, const unsigned int version)
148  {
149  Analyzer::serialize(ar, version);
150  ar & speciesId_;
151  ar & capacity_;
152 
153  ar & nBond_;
154  ar & nMolecule_;
155  ar & accumulator_;
156  }
157 
158 }
159 #endif
void serialize(Archive &ar, BoundaryEnsemble::Type &data, const unsigned int version)
Serialize a BoundaryEnsemble::Type enum value.
File containing preprocessor macros for error handling.
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
Autocorrelation for bond stress of a molecule.
A Species represents a set of chemically similar molecules.