Simpatico  v1.10
AutoCorrAnalyzer.h
1 #ifndef DDMD_AUTO_CORR_ANALYZER_H
2 #define DDMD_AUTO_CORR_ANALYZER_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 <ddMd/analyzers/Analyzer.h> // base class
12 #include <util/accumulators/AutoCorrelation.h> // member template
13 
14 #include <ddMd/simulation/Simulation.h> // used in implementation
15 
16 namespace DdMd
17 {
18 
19  using namespace Util;
20 
29  template <typename Data, typename Product>
30  class AutoCorrAnalyzer : public Analyzer
31  {
32 
33  public:
34 
40  AutoCorrAnalyzer(Simulation& simulation);
41 
46  {}
47 
53  virtual void readParameters(std::istream& in);
54 
60  virtual void loadParameters(Serializable::IArchive &ar);
61 
67  virtual void save(Serializable::OArchive &ar);
68 
72  virtual void clear();
73 
77  virtual void setup();
78 
84  virtual void sample(long iStep);
85 
89  virtual void output();
90 
91  protected:
92 
98  virtual void computeData()
99  {}
100 
104  virtual Data data() = 0;
105 
106  private:
107 
109  std::ofstream outputFile_;
110 
112  AutoCorrelation<Data, Product>* accumulatorPtr_;
113 
115  int bufferCapacity_;
116 
118  int maxStageId_;
119 
121  long isInitialized_;
122 
123  };
124 
125 }
126 #endif
Abstract base for periodic output and/or analysis actions.
Compute an autocorrelation function for a sequence of Data values.
Parallel domain decomposition (DD) MD simulation.
Main object for a domain-decomposition MD simulation.
Saving / output archive for binary ostream.
Auto-correlation function, using hierarchical algorithm.
Utility classes for scientific computation.
Definition: accumulators.mod:1
virtual void computeData()
Compute Data value, call on all processors.
Saving archive for binary istream.
virtual ~AutoCorrAnalyzer()
Destructor.