Simpatico  v1.10
mcMd/trajectory/TrajectoryReader.h
1 #ifndef MCMD_TRAJECTORY_READER_H
2 #define MCMD_TRAJECTORY_READER_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 <simp/boundary/Boundary.h> // typedef
12 #include <util/global.h>
13 
14 #include <iostream>
15 
16 namespace McMd
17 {
18 
19  class Simulation;
20  class System;
21 
22  using namespace Util;
23  using namespace Simp;
24 
31  {
32 
33  public:
34 
38  TrajectoryReader(System& system);
39 
43  virtual ~TrajectoryReader();
44 
57  virtual void open(std::string filename) = 0;
58 
67  virtual bool readFrame() = 0;
68 
72  virtual void close() = 0;
73 
74  protected:
75 
78 
80  System &system() const;
81 
83  Simulation &simulation() const;
84 
86  Boundary &boundary() const;
87 
91  virtual void addMolecules();
92 
93  private:
94 
96  Boundary *boundaryPtr_;
97 
99  System *systemPtr_;
100 
102  Simulation *simulationPtr_;
103 
104  }; // end class TrajectoryReader
105 
106  // Inline functions
107 
108  /*
109  * Get the parent System.
110  */
112  {
113  assert(systemPtr_);
114  return *systemPtr_;
115  }
116 
117  /*
118  * Get the parent Simulation.
119  */
121  {
122  assert(simulationPtr_);
123  return *simulationPtr_;
124  }
125 
126  /*
127  * Get the Boundary.
128  */
130  {
131  assert(boundaryPtr_);
132  return *boundaryPtr_;
133  }
134 
135 }
136 #endif
System & system() const
Get a reference to the parent System.
An orthorhombic periodic unit cell.
A set of interacting Molecules enclosed by a Boundary.
Definition: System.h:115
File containing preprocessor macros for error handling.
Classes used by all simpatico molecular simulations.
Simulation & simulation() const
Get a reference to the parent Simulation.
The main object in a simulation, which coordinates others.
Utility classes for scientific computation.
Definition: accumulators.mod:1
Trajectory file reader (base class).
int nAtomTotal_
Total number of atoms (all species)
Boundary & boundary() const
Get the Boundary.
Single-processor Monte Carlo (MC) and molecular dynamics (MD).