Simpatico  v1.10
mcMd/analyzers/system/AtomMSD.h
1 #ifndef MCMD_ATOM_MSD_H
2 #define MCMD_ATOM_MSD_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/MeanSqDispArray.h> // member template
14 #include <util/space/Vector.h> // member template parameter
15 #include <util/containers/DArray.h> // member template
16 
17 namespace McMd
18 {
19 
20  using namespace Util;
21 
28  class AtomMSD : public SystemAnalyzer<System>
29  {
30 
31  public:
32 
38  AtomMSD(System &system);
39 
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  virtual void setup();
74 
80  virtual void sample(long iStep);
81 
82 
86  virtual void output();
87 
88  private:
89 
91  std::ofstream outputFile_;
92 
94  MeanSqDispArray<Vector> accumulator_;
95 
97  DArray<Vector> truePositions_;
98 
100  DArray<Vector> oldPositions_;
101 
103  DArray<IntVector> shifts_;
104 
106  int speciesId_;
107 
109  int atomId_;
110 
112  int nMolecule_;
113 
115  int capacity_;
116 
118  int isInitialized_;
119 
120  };
121 
122  /*
123  * Serialize to/from an archive.
124  */
125  template <class Archive>
126  void AtomMSD::serialize(Archive& ar, const unsigned int version)
127  {
128  Analyzer::serialize(ar, version);
129  ar & speciesId_;
130  ar & atomId_;
131  ar & capacity_;
132  ar & accumulator_;
133  ar & truePositions_;
134  ar & oldPositions_;
135  ar & shifts_;
136  ar & nMolecule_;
137  }
138 
139 }
140 #endif
void serialize(Archive &ar, const unsigned int version)
Serialize to/from an archive.
A set of interacting Molecules enclosed by a Boundary.
Definition: System.h:115
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
Autocorrelation for vector separation of two atoms on a molecule.
Mean-squared displacement (MSD) vs.
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).