Simpatico  v1.10
mcMd/analyzers/system/VanHove.h
1 #ifndef MCMD_VAN_HOVE_H
2 #define MCMD_VAN_HOVE_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/containers/DArray.h> // member template
14 #include <util/accumulators/AutoCorr.h> // member template parameter
15 #include <util/space/Vector.h> // member template parameter
16 
17 #include <util/global.h>
18 
19 #include <iostream>
20 #include <complex>
21 
22 namespace McMd
23 {
24 
25  using namespace Util;
26 
78  class VanHove : public SystemAnalyzer<System>
79  {
80  public:
81 
87  VanHove(System &system);
88 
92  ~VanHove();
93 
108  virtual void readParameters(std::istream& in);
109 
115  virtual void loadParameters(Serializable::IArchive& ar);
116 
122  virtual void save(Serializable::OArchive& ar);
123 
130  template <class Archive>
131  void serialize(Archive& ar, const unsigned int version);
132 
136  virtual void setup();
137 
143  void sample(long iStep);
144 
148  virtual void output();
149 
150  private:
151 
153  std::ofstream outputFile_;
154 
156  DArray< AutoCorr< std::complex<double>, std::complex<double> > >
157  accumulators_;
158 
160  DArray< std::complex<double> > fourierModes_;
161 
163  DArray<IntVector> waveIntVectors_;
164 
166  DArray<Vector> waveVectors_;
167 
169  DArray<double> atomTypeCoeffs_;
170 
172  int nWave_;
173 
175  int nBuffer_;
176 
178  int nSample_;
179 
181  int nAtomType_;
182 
184  bool isInitialized_;
185 
187  void makeWaveVectors();
188 
189  };
190 
191  /*
192  * Serialize to/from an archive.
193  */
194  template <class Archive>
195  void VanHove::serialize(Archive& ar, const unsigned int version)
196  {
197  Analyzer::serialize(ar, version);
198  ar & nAtomType_;
199  ar & atomTypeCoeffs_;
200  ar & nBuffer_;
201  ar & nWave_;
202  ar & waveIntVectors_;
203  ar & accumulators_;
204  ar & nSample_;
205  }
206 
207 }
208 #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.
Evaluates the van Hove function S(k,t) for one or more wavevector k.
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.
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, const unsigned int version)
Serialize to/from an archive.