Simpatico  v1.10
SystemAnalyzer.h
1 #ifndef MCMD_SYSTEM_ANALYZER_H
2 #define MCMD_SYSTEM_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/Analyzer.h>
12 #include <mcMd/simulation/Simulation.h>
13 #include <util/global.h> // assert in inline function
14 
15 namespace McMd
16 {
17 
18  using namespace Util;
19 
28  template <class SystemType>
29  class SystemAnalyzer : public Analyzer
30  {
31 
32  public:
33 
39  SystemAnalyzer(SystemType& system);
40 
44  virtual ~SystemAnalyzer();
45 
46  protected:
47 
51  SystemType& system();
52 
53  private:
54 
56  SystemType* systemPtr_;
57 
58  };
59 
60  /*
61  * Constructor.
62  */
63  template <class SystemType>
65  : Analyzer(),
66  systemPtr_(&system)
67  { setFileMaster(system.fileMaster()); }
68 
69  /*
70  * Destructor.
71  */
72  template <class SystemType>
74  {}
75 
76  /*
77  * Return reference to parent system.
78  */
79  template <class SystemType>
81  {
82  assert(systemPtr_);
83  return *systemPtr_;
84  }
85 
86 }
87 #endif
SystemAnalyzer(SystemType &system)
Constructor.
void setFileMaster(FileMaster &fileMaster)
Set the FileMaster to use to open files.
SystemType & system()
Return reference to parent system.
File containing preprocessor macros for error handling.
virtual ~SystemAnalyzer()
Destructor.
Abstract base for periodic output and/or analysis actions.
Utility classes for scientific computation.
Definition: accumulators.mod:1
Template for Analyzer associated with one System.
Single-processor Monte Carlo (MC) and molecular dynamics (MD).