Simpatico  v1.10
LinkLTPos.h
1 #ifndef LINK_LT_POS_H
2 #define LINK_LT_POS_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> // base class template parameter
13 #include <util/accumulators/Distribution.h>
14 #include <util/containers/DArray.h>
15 #include <mcMd/links/LinkMaster.h>
16 #include <mcMd/links/LinkEvents.h>
17 #include <util/misc/Observer.h>
18 #include <util/global.h>
19 
20 namespace McMd
21 {
22 
23  using namespace Util;
24 
31  class LinkLTPos : public SystemAnalyzer<System>,
32  public Observer<LinkAddEvent>,
33  public Observer<LinkRemoveEvent>,
34  public Observer<ReSetAtomEvent>
35  {
36 
37  public:
38 
44  LinkLTPos(System &system);
45 
51  virtual void readParameters(std::istream& in);
52 
56  virtual void setup();
57 
63  void sample(long iStep);
64 
65  virtual void update(const LinkAddEvent& event);
66 
67  virtual void update(const LinkRemoveEvent& event);
68 
69  virtual void update(const ReSetAtomEvent& event);
70 
74  virtual void output();
75 
76  private:
77 
78  // Output file stream
79  std::ofstream outputFile_;
80 
81  // Distribution statistical accumulator
82  DArray<Distribution> accumulator_;
83 
84  // Parameters for the statistical accumulator;
85  double min_;
86  double max_;
87  int nBin_;
88 
89  // Dinamic 2d-array of creation times for each link end le and position
90  // i along the chain le=tag*2+endID 0<=le<2*linkCapacity, 0<=i<nMolecule
91  DMatrix<int> birthTimes_;
92 
93  // Allocated dimension for birthTimes_ array, same as links_ container.
94  int linkCapacity_;
95 
96  };
97 
98 }
99 #endif
Event signalling the reset of an atom from the LinkMaster.
Definition: LinkEvents.h:105
Abstract class template for observer in the observer design pattern.
Definition: Notifier.h:19
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
Utility classes for scientific computation.
Definition: accumulators.mod:1
Event signalling addition of Link to the LinkMaster.
Definition: LinkEvents.h:20
LinkLTPos evaluates how long the slip-springs live as a function of position along the chain...
Definition: LinkLTPos.h:31
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).