Simpatico  v1.10
ExternalEnergyAverage.h
1 #ifndef DDMD_EXTERNAL_ENERGY_AVERAGE_H
2 #define DDMD_EXTERNAL_ENERGY_AVERAGE_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 #include <util/accumulators/Average.h>
14 
15 namespace DdMd
16 {
17 
18  using namespace Util;
19 
28  {
29 
30  public:
31 
37  ExternalEnergyAverage(Simulation& simulation);
38 
42  virtual ~ExternalEnergyAverage();
43 
49  virtual void readParameters(std::istream& in);
50 
56  virtual void loadParameters(Serializable::IArchive &ar);
57 
63  virtual void save(Serializable::OArchive &ar);
64 
68  virtual void clear();
69 
75  virtual void sample(long iStep);
76 
80  virtual void output();
81 
82  private:
83 
85  std::ofstream outputFile_;
86 
88  Average *accumulator_;
89 
91  int nSamplePerBlock_;
92 
94  bool isInitialized_;
95 
96  };
97 
98 }
99 #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.
Periodically write simulation energies to Log output.
Saving / output archive for binary ostream.
Utility classes for scientific computation.
Definition: accumulators.mod:1
Saving archive for binary istream.