Simpatico  v1.10
MdEnergyAnalyzer.h
1 #ifndef MCMD_MD_ENERGY_ANALYZER_H
2 #define MCMD_MD_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/mdSimulation/MdSystem.h>
13 
14 namespace Util{
15  class Average;
16 }
17 
18 namespace McMd
19 {
20 
21  using namespace Util;
22 
35  class MdEnergyAnalyzer : public SystemAnalyzer<MdSystem>
36  {
37 
38  public:
39 
45  MdEnergyAnalyzer(MdSystem& 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  Average* kineticAveragePtr_;
106  Average* potentialAveragePtr_;
107  #ifndef SIMP_NOPAIR
108  Average* pairAveragePtr_;
109  #endif
110  #ifdef SIMP_BOND
111  Average* bondAveragePtr_;
112  #endif
113  #ifdef SIMP_ANGLE
114  Average* angleAveragePtr_;
115  #endif
116  #ifdef SIMP_DIHEDRAL
117  Average* dihedralAveragePtr_;
118  #endif
119  #ifdef SIMP_COULOMB
120  Average* coulombRSpaceAveragePtr_;
121  Average* coulombKSpaceAveragePtr_;
122  Average* coulombAveragePtr_;
123 
125  bool coulombComponents_;
126  #endif
127  #ifdef SIMP_EXTERNAL
128  Average* externalAveragePtr_;
129  #endif
130 
131  // Number of sample per block average
132  int nSamplePerBlock_;
133 
135  bool isInitialized_;
136 
137  };
138 
139 }
140 #endif
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).
A System for Molecular Dynamics simulation.
Definition: MdSystem.h:68
Compute averages and output block averages of energy components.
virtual ~MdEnergyAnalyzer()
Destructor.