Simpatico  v1.10
ddMd/analyzers/AverageAnalyzer.h
1 #ifndef DDMD_AVERAGE_ANALYZER_H
2 #define DDMD_AVERAGE_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>
12 
13 namespace Util {
14  class Average;
15 }
16 
17 namespace DdMd
18 {
19 
20  class Simulation;
21 
22  using namespace Util;
23 
34  class AverageAnalyzer : public Analyzer
35  {
36 
37  public:
38 
44  AverageAnalyzer(Simulation& simulation);
45 
49  virtual ~AverageAnalyzer();
50 
60  virtual void readParameters(std::istream& in);
61 
67  virtual void loadParameters(Serializable::IArchive &ar);
68 
74  virtual void save(Serializable::OArchive &ar);
75 
79  virtual void clear();
80 
84  virtual void setup();
85 
91  virtual void sample(long iStep);
92 
96  virtual void output();
97 
98  protected:
99 
105  virtual void compute() = 0;
106 
112  virtual double value() = 0;
113 
114  private:
115 
117  std::ofstream outputFile_;
118 
120  Average *accumulatorPtr_;
121 
123  int nSamplePerBlock_;
124 
126  bool isInitialized_;
127 
128  };
129 
130 }
131 #endif
Abstract base for periodic output and/or analysis actions.
Calculates the average and variance of a sampled property.
Definition: Average.h:43
Parallel domain decomposition (DD) MD simulation.
Main object for a domain-decomposition MD simulation.
Saving / output archive for binary ostream.
Analyze average and block averages of a single floating point variable.
Utility classes for scientific computation.
Definition: accumulators.mod:1
Saving archive for binary istream.