Simpatico  v1.10
McEnergyAnalyzer.h
1 #ifndef MCMD_MC_ENERGY_ANALYZER_H
2 #define MCMD_MC_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 <mcMd/analyzers/SystemAnalyzer.h>
12 #include <mcMd/mcSimulation/McSystem.h>
13 
14 namespace Util{
15  class Average;
16 }
17 
18 namespace McMd
19 {
20 
21  using namespace Util;
22 
35  class McEnergyAnalyzer : public SystemAnalyzer<McSystem>
36  {
37 
38  public:
39 
45  McEnergyAnalyzer(McSystem& system);
46 
51  {}
52 
58  virtual void readParameters(std::istream& in);
59 
65  virtual void loadParameters(Serializable::IArchive &ar);
66 
72  virtual void save(Serializable::OArchive &ar);
73 
77  virtual void clear();
78 
84  virtual void setup();
85 
91  virtual void sample(long iStep);
92 
96  virtual void output();
97 
98  private:
99 
100  // Output file stream
101  std::ofstream outputFile_;
102 
103  // Pointers to average accumulators for energy and components
104  Average* totalAveragePtr_;
105  #ifndef SIMP_NOPAIR
106  Average* pairAveragePtr_;
107  #endif
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
A System for use in a Markov chain Monte Carlo simulation.
Definition: McSystem.h:52
Calculates the average and variance of a sampled property.
Definition: Average.h:43
Saving / output archive for binary ostream.
Utility classes for scientific computation.
Definition: accumulators.mod:1
Template for Analyzer associated with one System.
Saving archive for binary istream.
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
virtual ~McEnergyAnalyzer()
Destructor.
Compute averages and output block averages of energy components.