Simpatico  v1.10
EnergyAnalyzer.h
1 #ifndef DDMD_ENERGY_ANALYZER_H
2 #define DDMD_ENERGY_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 #include <ddMd/simulation/Simulation.h>
13 
14 namespace Util{
15  class Average;
16 }
17 
18 namespace DdMd
19 {
20 
21  class Simulation;
22  using namespace Util;
23 
36  class EnergyAnalyzer : public Analyzer
37  {
38 
39  public:
40 
46  EnergyAnalyzer(Simulation& simulation);
47 
51  virtual ~EnergyAnalyzer()
52  {}
53 
59  virtual void readParameters(std::istream& in);
60 
66  virtual void loadParameters(Serializable::IArchive &ar);
67 
73  virtual void save(Serializable::OArchive &ar);
74 
78  virtual void clear();
79 
85  virtual void setup();
86 
92  virtual void sample(long iStep);
93 
97  virtual void output();
98 
99  private:
100 
101  // Output file stream
102  std::ofstream outputFile_;
103 
104  // Pointers to average accumulators for energy and components
105  Average* totalAveragePtr_;
106  Average* kineticAveragePtr_;
107  Average* pairAveragePtr_;
108  #ifdef SIMP_BOND
109  Average* bondAveragePtr_;
110  #endif
111  #ifdef SIMP_ANGLE
112  Average* angleAveragePtr_;
113  #endif
114  #ifdef SIMP_DIHEDRAL
115  Average* dihedralAveragePtr_;
116  #endif
117  #ifdef SIMP_EXTERNAL
118  Average* externalAveragePtr_;
119  #endif
120 
121  // Number of sample per block average
122  int nSamplePerBlock_;
123 
125  long isInitialized_;
126 
127  };
128 
129 }
130 #endif
Abstract base for periodic output and/or analysis actions.
virtual ~EnergyAnalyzer()
Destructor.
Calculates the average and variance of a sampled property.
Definition: Average.h:43
Compute averages and output block averages of energy components.
Parallel domain decomposition (DD) MD simulation.
Main object for a domain-decomposition MD simulation.
Saving / output archive for binary ostream.
Utility classes for scientific computation.
Definition: accumulators.mod:1
Saving archive for binary istream.