Simpatico  v1.10
tools/analyzers/AnalyzerManager.cpp
1 /*
2 * Simpatico - Simulation Package for Polymeric and Molecular Liquids
3 *
4 * Copyright 2010 - 2017, The Regents of the University of Minnesota
5 * Distributed under the terms of the GNU General Public License.
6 */
7 
8 #include "AnalyzerManager.h"
9 
10 namespace Tools
11 {
12 
13  using namespace Util;
14 
15  /*
16  * Constructor.
17  */
19  : Manager<Analyzer>()
20  { setClassName("AnalyzerManager"); }
21 
22  /*
23  * Destructor.
24  */
26  {}
27 
28  /*
29  * Read parameter block (without begin and end).
30  *
31  * \param in input parameter file stream.
32  */
33  void AnalyzerManager::readParameters(std::istream &in)
34  {
36  }
37 
38  /*
39  * Call setup method of each analyzer.
40  */
42  {
43  for (int i = 0; i < size(); ++i) {
44  (*this)[i].setup();
45  }
46  }
47 
48  /*
49  * Call clear method of each analyzer.
50  */
52  {
53  for (int i = 0; i < size(); ++i) {
54  (*this)[i].clear();
55  }
56  }
57 
58  /*
59  * Call sample method of each analyzer.
60  */
61  void AnalyzerManager::sample(long iStep)
62  {
63  for (int i=0; i < size(); ++i) {
64  if ((*this)[i].isAtInterval(iStep)) {
65  (*this)[i].sample(iStep);
66  }
67  }
68  }
69 
70  /*
71  * Call output method of each analyzer.
72  */
74  {
75  for (int i=0; i < size(); ++i) {
76  (*this)[i].output();
77  }
78  }
79 
80 }
void clear()
Call clear method of each Analyzer.
Abstract base for periodic output and/or analysis actions.
Template container for pointers to objects with a common base class.
Definition: Manager.h:38
void setup()
Call setup method of each Analyzer.
Utility classes for scientific computation.
Definition: accumulators.mod:1
virtual void readParameters(std::istream &in)
Read parameter block (without begin and end).
void sample(long iStep)
Call sample method of each Analyzer, if scheduled.
Single-processor classes for pre- and post-processing MD trajectories.
void output()
Call output method of each analyzer.
virtual void readParameters(std::istream &in)
Read child blocks, return when closing bracket encountered.
Definition: Manager.h:356
void setClassName(const char *className)
Set class name string.
int size() const
Get logical size.