Simpatico  v1.10
LinkMSD.h
1 #ifndef LINK_MSD_H
2 #define LINK_MSD_H
3 
4 /*
5 * Simpatico - Simulation Package for Polymeric and Molecular Liquids
6 *
7 * Copyright 2010 - 2014, 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> // base class template
12 #include <mcMd/simulation/System.h> // class template parameter
13 #include <util/accumulators/Average.h> // member
14 #include <util/containers/DArray.h> // member template
15 #include <util/space/Vector.h> // member template parameter
16 #include <mcMd/links/LinkMaster.h>
17 #include <mcMd/links/LinkEvents.h>
18 #include <util/misc/Observer.h>
19 #include <util/global.h>
20 
21 #include <cstdio>
22 #include <cstring>
23 
24 namespace McMd {
25  class Species;
26 }
27 
28 namespace McMd
29 {
30 
31  using namespace Util;
32  using namespace Simp;
33 
40  class LinkMSD : public SystemAnalyzer<System>,
41  public Observer<LinkAddEvent>,
42  public Observer<LinkRemoveEvent>
43  {
44 
45  public:
46 
52  LinkMSD(System &system);
53 
59  virtual void readParameters(std::istream& in);
60 
64  virtual void setup();
65 
71  virtual void sample(long iStep);
72 
73  virtual void update(const LinkAddEvent& event);
74 
75  virtual void update(const LinkRemoveEvent& event);
76 
80  virtual void output();
81 
82  private:
83 
85  std::ofstream outputFile_;
86 
88  int capacity_;
89 
91  int linkCapacity_;
92 
94  int nSamplePerBlock_;
95 
97  DArray<Average> accumulator_;
98 
100  DArray<int> i0_;
101 
103  DArray<int> t0_;
104 
105  };
106 
107 }
108 #endif
Abstract class template for observer in the observer design pattern.
Definition: Notifier.h:19
Evaluates msd of link ends along the chains.
Definition: LinkMSD.h:40
A set of interacting Molecules enclosed by a Boundary.
Definition: System.h:115
File containing preprocessor macros for error handling.
Event signalling removal of a Link from the LinkMaster.
Definition: LinkEvents.h:78
Classes used by all simpatico molecular simulations.
Utility classes for scientific computation.
Definition: accumulators.mod:1
Event signalling addition of Link to the LinkMaster.
Definition: LinkEvents.h:20
Template for Analyzer associated with one System.
Dynamically allocatable contiguous array template.
Definition: DArray.h:31
Single-processor Monte Carlo (MC) and molecular dynamics (MD).