MEDYAN  3.1
Software for simulating active matter dynamics
Output.h
Go to the documentation of this file.
1 
2 //------------------------------------------------------------------
3 // **MEDYAN** - Simulation Package for the Mechanochemical
4 // Dynamics of Active Networks, v3.1
5 //
6 // Copyright (2015-2016) Papoian Lab, University of Maryland
7 //
8 // ALL RIGHTS RESERVED
9 //
10 // See the MEDYAN web page for more information:
11 // http://www.medyan.org
12 //------------------------------------------------------------------
13 
14 #ifndef MEDYAN_Output_h
15 #define MEDYAN_Output_h
16 
17 #include <fstream>
18 
19 #include "common.h"
20 
21 #include "Parser.h"
22 
24 class CompartmentGrid;
25 class SubSystem;
26 
28 
34 class Output {
35 protected:
36  ofstream _outputFile;
37 
38  SubSystem* _subSystem = nullptr;
39 
40 public:
42  Output(string outputFileName, SubSystem* s) {
43  _outputFile.open(outputFileName);
44  if(!_outputFile.is_open()) {
45  cout << "There was an error opening file " << outputFileName
46  << " for output. Exiting." << endl;
47  exit(EXIT_FAILURE);
48  }
49  cout << "Opening file " << outputFileName << endl;
50 
51  _subSystem = s;
52  }
54  ~Output() {_outputFile.close();}
55 
57  virtual void print(int snapshot) = 0;
58 };
59 
62 class BasicSnapshot : public Output {
63 
64 public:
65  BasicSnapshot(string outputFileName, SubSystem* s) : Output(outputFileName, s) {}
67 
68  virtual void print(int snapshot);
69 };
70 
73 class BirthTimes : public Output {
74 
75 public:
76  BirthTimes(string outputFileName, SubSystem* s) : Output(outputFileName, s) {}
78 
79  virtual void print(int snapshot);
80 };
81 
83 class Forces : public Output {
84 
85 public:
86  Forces(string outputFileName, SubSystem* s) : Output(outputFileName, s) {}
87  ~Forces() {}
88 
89  virtual void print(int snapshot);
90 };
91 
97 class Tensions : public Output {
98 
99 public:
100  Tensions(string outputFileName, SubSystem* s) : Output(outputFileName, s) {}
102 
103  virtual void print(int snapshot);
104 };
105 
111 class WallTensions : public Output {
112 
113 public:
114  WallTensions(string outputFileName, SubSystem* s) :
115  Output(outputFileName, s) {}
117 
118 
119  virtual void print(int snapshot);
120 };
121 
122 
124 class Types : public Output {
125 
126 public:
127  Types(string outputFileName, SubSystem* s) : Output(outputFileName, s) {}
128  ~Types() {}
129 
130  virtual void print(int snapshot);
131 };
132 
133 
136 class Chemistry : public Output {
137 
140 
141 public:
142  Chemistry(string outputFileName, SubSystem* s,
143  ChemistryData chemData, CompartmentGrid* grid)
144 
145  : Output(outputFileName, s),
146  _chemData(chemData), _grid(grid) {}
147 
149 
150  virtual void print(int snapshot);
151 };
152 
153 
155 class MotorLifetimes : public Output {
156 
157 public:
158  MotorLifetimes(string outputFileName, SubSystem* s) : Output(outputFileName, s) {}
160 
161  virtual void print(int snapshot);
162 };
163 
165 class MotorWalkLengths : public Output {
166 
167 public:
168  MotorWalkLengths(string outputFileName, SubSystem* s) : Output(outputFileName, s) {}
170 
171  virtual void print(int snapshot);
172 };
173 
175 class LinkerLifetimes : public Output {
176 
177 public:
178  LinkerLifetimes(string outputFileName, SubSystem* s) : Output(outputFileName, s) {}
180 
181  virtual void print(int snapshot);
182 };
183 
186 
187 public:
188  FilamentTurnoverTimes(string outputFileName, SubSystem* s) : Output(outputFileName, s) {}
190 
191  virtual void print(int snapshot);
192 };
193 
194 #endif
Chemistry(string outputFileName, SubSystem *s, ChemistryData chemData, CompartmentGrid *grid)
Definition: Output.h:142
SubSystem * _subSystem
Definition: Output.h:38
BasicSnapshot(string outputFileName, SubSystem *s)
Definition: Output.h:65
~MotorLifetimes()
Definition: Output.h:159
Tensions(string outputFileName, SubSystem *s)
Definition: Output.h:100
Print type of each species.
Definition: Output.h:124
BirthTimes(string outputFileName, SubSystem *s)
Definition: Output.h:76
~Output()
Destructor, which closes the output file.
Definition: Output.h:54
~Types()
Definition: Output.h:128
Print all chemical species in the system, including diffusing and bulk species, filament, motors, linkers and branchers.
Definition: Output.h:136
~Chemistry()
Definition: Output.h:148
Print MotorGhost walk lengths.
Definition: Output.h:165
~BasicSnapshot()
Definition: Output.h:66
Output(string outputFileName, SubSystem *s)
Constructor, which opens the output file.
Definition: Output.h:42
To print a specified output into a file.
Definition: Output.h:34
Print Linker binding lifetimes.
Definition: Output.h:175
Print wall tension for each pinned filament: k * l * nhat where k is the stretching force constant of...
Definition: Output.h:111
~Tensions()
Definition: Output.h:101
Forces(string outputFileName, SubSystem *s)
Definition: Output.h:86
virtual void print(int snapshot)=0
To be implemented in sub classes.
FilamentTurnoverTimes(string outputFileName, SubSystem *s)
Definition: Output.h:188
~WallTensions()
Definition: Output.h:116
Print MotorGhost binding lifetimes.
Definition: Output.h:155
Types(string outputFileName, SubSystem *s)
Definition: Output.h:127
Struct to hold Species and Reaction information.
Definition: Parser.h:90
WallTensions(string outputFileName, SubSystem *s)
Definition: Output.h:114
Print basic information about all Filament, Linker, MotorGhost, and BranchingPoint.
Definition: Output.h:62
Print birth times of beads for each Filament, Linker, MotorGhost, and BranchingPoint.
Definition: Output.h:73
MotorWalkLengths(string outputFileName, SubSystem *s)
Definition: Output.h:168
~LinkerLifetimes()
Definition: Output.h:179
Print tension for each Filament, Linker, and MotorGhost.
Definition: Output.h:97
A simple n-dimensional grid of Compartment objects.
Print forces on beads for each Filament.
Definition: Output.h:83
ChemistryData _chemData
chemistry data of this system
Definition: Output.h:138
CompartmentGrid * _grid
compartment grid of the system
Definition: Output.h:139
Manages all Movables and Reactables.
Definition: SubSystem.h:57
Print Filament turnover times.
Definition: Output.h:185
~Forces()
Definition: Output.h:87
ofstream _outputFile
The output file being used.
Definition: Output.h:36
LinkerLifetimes(string outputFileName, SubSystem *s)
Definition: Output.h:178
~BirthTimes()
Definition: Output.h:77
MotorLifetimes(string outputFileName, SubSystem *s)
Definition: Output.h:158