Simpatico  v1.10
BlockRadiusGyration.h
1 #ifndef MCMD_BLOCK_RADIUS_GYRATION_H
2 #define MCMD_BLOCK_RADIUS_GYRATION_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> // class template parameter
13 #include <util/accumulators/Average.h> // member
14 #include <util/containers/DArray.h> // member template
15 #include <util/space/Vector.h> // member template parameter
16 
17 #include <cstdio>
18 #include <cstring>
19 
20 namespace Simp {
21  class Species;
22 }
23 
24 namespace McMd
25 {
26 
27  using namespace Util;
28  using namespace Simp;
29 
56  class BlockRadiusGyration : public SystemAnalyzer<System>
57  {
58 
59  public:
60 
66  BlockRadiusGyration(System &system);
67 
83  virtual void readParameters(std::istream& in);
84 
88  virtual void setup();
89 
95  virtual void sample(long iStep);
96 
100  virtual void output();
101 
107  virtual void save(Serializable::OArchive& ar);
108 
114  virtual void loadParameters(Serializable::IArchive& ar);
115 
119  template <class Archive>
120  void serialize(Archive& ar, const unsigned int version);
121 
122  private:
123 
125  std::ofstream outputFile_;
126 
128  DArray<Average> accumulators_;
129 
131  DArray<Vector> positions_;
132 
134  DArray<Vector> rCom_;
135 
137  DArray<int> iTypeNAtom_;
138 
140  DArray<double> dRSq_;
141 
143  DArray<double> dRSqPair_;
144 
146  Species* speciesPtr_;
147 
149  int nAtomType_;
150 
152  int nAtomTypePairs_;
153 
155  int nSamplePerBlock_;
156 
158  int speciesId_;
159 
161  int nAtom_;
162 
164  bool isInitialized_;
165 
166  };
167 
171  template <class Archive>
172  void BlockRadiusGyration::serialize(Archive& ar, const unsigned int version)
173  {
174  Analyzer::serialize(ar, version);
175  ar & nSamplePerBlock_;
176  ar & speciesId_;
177  ar & nAtom_;
178  ar & nAtomType_;
179  ar & nAtomTypePairs_;
180  ar & accumulators_;
181  }
182 
183 }
184 #endif
void serialize(Archive &ar, BoundaryEnsemble::Type &data, const unsigned int version)
Serialize a BoundaryEnsemble::Type enum value.
Radius of gyration of different blocks in 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.
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.