Simpatico  v1.10
TensorAverageAnalyzer.h
1 #ifndef DDMD_TENSOR_AVERAGE_ANALYZER_H
2 #define DDMD_TENSOR_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> // Base class header
12 
13 namespace Util {
14  class Tensor;
15  class TensorAverage;
16 }
17 
18 namespace DdMd
19 {
20 
21  class Simulation;
22 
23  using namespace Util;
24 
36  {
37 
38  public:
39 
45  TensorAverageAnalyzer(Simulation& simulation);
46 
50  virtual ~TensorAverageAnalyzer();
51 
61  virtual void readParameters(std::istream& in);
62 
68  virtual void loadParameters(Serializable::IArchive &ar);
69 
75  virtual void save(Serializable::OArchive &ar);
76 
80  virtual void clear();
81 
85  virtual void setup();
86 
95  virtual void sample(long iStep);
96 
100  virtual void output();
101 
102  protected:
103 
109  virtual void compute() = 0;
110 
116  virtual Tensor value() = 0;
117 
118  private:
119 
121  std::ofstream outputFile_;
122 
124  TensorAverage *accumulatorPtr_;
125 
127  int nSamplePerBlock_;
128 
130  bool isInitialized_;
131 
132  };
133 
134 }
135 #endif
Abstract base for periodic output and/or analysis actions.
Parallel domain decomposition (DD) MD simulation.
Main object for a domain-decomposition MD simulation.
A Tensor represents a Cartesian tensor.
Definition: Tensor.h:32
Saving / output archive for binary ostream.
Utility classes for scientific computation.
Definition: accumulators.mod:1
Calculates averages of all components of a Tensor-valued variable.
Definition: TensorAverage.h:32
Analyzer that computes averages and block averages of a single Tensor.
Saving archive for binary istream.