.Simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
DataSnapshot.h
Go to the documentation of this file.
1 // DataSnapshot.h - DataSnapshot class declaration.
2 // Written By Jesse Z. Zhong
4 #ifndef __Data_Snapshot_H__
5 #define __Data_Snapshot_H__
6 #pragma region Includes
7 #include "stdafx.h"
8 #include "ShellData.h"
9 #include "DataFile.h"
10 #include "..\MDSimulation\Constants\AtomicProperties.h"
11 using namespace std;
12 using namespace rapidjson;
13 #pragma endregion
14 namespace DataReader {
18  class DataSnapshot : public DataFile {
19  public:
25  #pragma region Snapshot Keys
26  static const char* SS_SnapshotID;
28  static const char* SS_SimTime;
29  static const char* SS_Radius;
30  static const char* SS_Bins;
31  static const char* SS_ParticleCount;
32  static const char* SD_Radius;
33  static const char* SD_Particles;
34  static const char* SD_Density;
35  static const char* SD_Temperature;
36  static const char* SD_MaxTemperature;
37  static const char* SD_Velocity;
38  static const char* SD_Ionization;
39  static const char* SD_Percentage;
40  static const char* SD_KineticEnergy;
41  static const char* SD_KineticEnergyCom;
42  #pragma endregion
44  #pragma region Instance
45 
51  DataSnapshot(const string& fileName = "");
52 
56  virtual void Read(const string& fileName);
57  #pragma endregion
58  #pragma region Accessors
59  int GetSnapshotID() const;
61 
63  double GetSimulationTime() const;
64 
66  double GetBubbleRadius() const;
67 
69  double GetMeanVelocity() const;
70 
72  double GetMedianVelocity() const;
73 
75  unsigned long long GetTotalCollisions() const;
76 
78  unsigned long long GetTotalCellCrossings() const;
79 
81  unsigned long long GetTotalWallCollisions() const;
82 
84  unsigned long long GetTotalConeBoundaryCollisions() const;
85 
87  double GetFusionRate() const;
88 
90  int GetGasTypes() const;
91 
93  vector<ShellData>& GetShellData();
94 
96  double GetWallVelocity() const;
97 
99  double GetPressure() const;
100 
102  double GetMaxTemperature() const;
103 
105  double GetAvgTemperature() const;
106 
108  double GetMaxEnergy() const;
109 
111  double GetAvgEnergy() const;
112 
114  double GetMaxDensity() const;
115 
117  double GetAvgDensity() const;
118 
120  double GetKineticEnergy() const;
121 
123  double GetKineticEnergyCom() const;
124 
126  int GetParticleCount() const;
127 
129  vector<int> GetIonizations() const;
130  #pragma endregion
131  protected:
132  #pragma region Helper Methods
133  // Reads and parses shell data.
134  ShellData ReadShellData(Value& item);
135  #pragma endregion
136  #pragma region Data Members
137  int SnapshotID_;
140 
143 
147 
150 
153 
155  unsigned long long TotalCollisions_;
156 
158  unsigned long long TotalCellCrossings_;
159 
161  unsigned long long TotalWallCollisions_;
162 
164  unsigned long long TotalConeBoundaryCollisions_;
165 
167  double FusionRate_;
168 
170  vector<ShellData> ShellData_;
171 
174 
175  // Metadata fields.
176 
180 
183  double Pressure_;
184 
188 
192 
195  double MaxEnergy_;
196 
199  double AvgEnergy_;
200 
203  double MaxDensity_;
204 
207  double AvgDensity_;
208 
212 
215  // TODO This variable is currently unused
217 
220 
223  // TODO decide whether to keep this
224  vector<int> Ionizations_;
225  #pragma endregion
226  };
227 }
228 
232 ostream& operator<<(ostream& out, DataReader::DataSnapshot& data);
233 #endif// !__Data_Snapshot_H__
int GasTypes_
The number of gas types in this snapshot.
Definition: DataSnapshot.h:173
double MaxDensity_
The maximum density measured within the bubble during this snapshot.
Definition: DataSnapshot.h:203
Stores the information pertaining to each shell layer in the simulated system.
Definition: ShellData.h:21
static const char * SD_MaxTemperature
Shell temperature.
Definition: DataSnapshot.h:36
double AvgTemperature_
The average temperature throughout the bubble during this snapshot.
Definition: DataSnapshot.h:191
double FusionRate_
[details pending]
Definition: DataSnapshot.h:167
static const char * SD_Temperature
Shell temperature.
Definition: DataSnapshot.h:35
unsigned long long TotalCollisions_
The number of active particle collisions.
Definition: DataSnapshot.h:155
vector< int > Ionizations_
Number of ionizations during this snapshot.
Definition: DataSnapshot.h:224
double SimulationTime_
The time at which this snapshot was taken.
Definition: DataSnapshot.h:142
static const char * SS_ParticleCount
Particle count.
Definition: DataSnapshot.h:31
static const char * SD_Radius
Shell radius.
Definition: DataSnapshot.h:32
unsigned long long TotalConeBoundaryCollisions_
[details pending]
Definition: DataSnapshot.h:164
int ParticleCount_
The current particle count during this snapshot.
Definition: DataSnapshot.h:219
double AvgEnergy_
The average energy level throughout the bubble during this snapshot.
Definition: DataSnapshot.h:199
static const char * SD_Percentage
Shell gas percentages.
Definition: DataSnapshot.h:39
vector< ShellData > ShellData_
The list of shells that the bubble is composed of.
Definition: DataSnapshot.h:170
double KineticEnergyCom_
The kinetic energy &#39;?&#39; of particles in the bubble during this snapshot.
Definition: DataSnapshot.h:216
static const char * SD_Ionization
Shell ionization.
Definition: DataSnapshot.h:38
static const char * SD_KineticEnergy
Shell kinetic energy.
Definition: DataSnapshot.h:40
static const char * SS_SimTime
Simulation time.
Definition: DataSnapshot.h:28
double MaxEnergy_
The maximum energy level measured within the bubble during this snapshot.
Definition: DataSnapshot.h:195
static const char * SD_Particles
Shell particles.
Definition: DataSnapshot.h:33
double AvgDensity_
The average density throughout the bubble during this snapshot.
Definition: DataSnapshot.h:207
static const char * SD_Velocity
Shell velocity.
Definition: DataSnapshot.h:37
double MeanVelocity_
The average velocity of the particles.
Definition: DataSnapshot.h:149
static const char * SD_Density
Shell density.
Definition: DataSnapshot.h:34
double WallVelocity_
The velocity at which the wall is traveling in relations to the origin.
Definition: DataSnapshot.h:179
double Pressure_
The average pressure throughout the bubble during this snapshot.
Definition: DataSnapshot.h:183
double BubbleRadius_
The radius, measured from the center of the gas bubble to the bubble wall.
Definition: DataSnapshot.h:146
Base class for reading and storing simulation output.
Definition: DataFile.h:24
static const char * SS_Radius
Radius.
Definition: DataSnapshot.h:29
double KineticEnergy_
The kinetic energy of particles in the bubble during this snapshot.
Definition: DataSnapshot.h:211
unsigned long long TotalCellCrossings_
[details pending]
Definition: DataSnapshot.h:158
Stores simulation snapshot data.
Definition: DataSnapshot.h:18
double MedianVelocity_
The median velocity of the particles.
Definition: DataSnapshot.h:152
ostream & operator<<(ostream &out, DataReader::DataSnapshot &data)
Out stream operator overload for snapshots.
Definition: DataSnapshot.cpp:350
double MaxTemperature_
The maximum temperature measured within the bubble during this snapshot.
Definition: DataSnapshot.h:187
static const char * SS_Bins
Shell data.
Definition: DataSnapshot.h:30
unsigned long long TotalWallCollisions_
[details pending]
Definition: DataSnapshot.h:161