MercuryDPM  Alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MercuryData.h File Reference
#include <fstream>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>

Go to the source code of this file.

Classes

struct  MercuryParticle< NDIMS >
 
struct  MercuryParticle< 2 >
 
class  MercuryTimeStepIterator< NDIMS >
 
class  MercuryTimeStep< NDIMS >
 
class  MercuryTimeStepIterator< NDIMS >
 
class  MercuryDataFile
 
class  MercuryDataFile::IteratorProxy< NDIMS >
 

Functions

template<std::size_t NDIMS>
std::istream & operator>> (std::istream &in, MercuryParticle< NDIMS > &part)
 Read a single particle from a istream. More...
 
template<>
std::istream & operator>>< 2 > (std::istream &in, MercuryParticle< 2 > &part)
 
template<std::size_t NDIMS>
std::istream & operator>> (std::istream &in, MercuryTimeStep< NDIMS > &step)
 

Function Documentation

template<std::size_t NDIMS>
std::istream& operator>> ( std::istream &  in,
MercuryParticle< NDIMS > &  part 
)

Read a single particle from a istream.

Definition at line 116 of file MercuryData.h.

References MercuryParticle< NDIMS >::angularV, MercuryParticle< NDIMS >::position, MercuryParticle< NDIMS >::radius, MercuryParticle< NDIMS >::rotation, MercuryParticle< NDIMS >::speciesID, and MercuryParticle< NDIMS >::velocity.

117 {
118  std::size_t i;
119  for (i = 0; i < NDIMS; i++)
120  in >> part.position[i];
121 
122  for (i = 0; i < NDIMS; i++)
123  in >> part.velocity[i];
124 
125  in >> part.radius;
126 
127  for (i = 0; i < NDIMS; i++)
128  in >> part.rotation[i];
129 
130  for (i = 0; i < NDIMS; i++)
131  in >> part.angularV[i];
132 
133  in >> part.speciesID;
134 
135  return in;
136 }
double velocity[NDIMS]
Definition: MercuryData.h:51
double angularV[NDIMS]
Definition: MercuryData.h:59
double position[NDIMS]
Definition: MercuryData.h:47
double rotation[NDIMS]
Definition: MercuryData.h:55
std::size_t speciesID
Definition: MercuryData.h:69
template<std::size_t NDIMS>
std::istream& operator>> ( std::istream &  in,
MercuryTimeStep< NDIMS > &  step 
)

Reads the timestep header into the ts

Parameters
[in,out]inThe istream where we read from
[out]stepThe timestream read into
Returns
in for chaining.

Definition at line 333 of file MercuryData.h.

References MercuryTimeStep< NDIMS >::max_, MercuryTimeStep< NDIMS >::min_, MercuryTimeStep< NDIMS >::numParticles_, and MercuryTimeStep< NDIMS >::time_.

334 {
335  std::size_t i;
336  in >> step.numParticles_ >> step.time_;
337 
338  for (i = 0; i < NDIMS; i++)
339  in >> step.min_[i];
340 
341  for (i = 0; i < NDIMS; i++)
342  in >> step.max_[i];
343 
344  return in;
345 }
double min_[NDIMS]
Definition: MercuryData.h:306
double max_[NDIMS]
Definition: MercuryData.h:306
std::size_t numParticles_
Definition: MercuryData.h:302
template<>
std::istream& operator>>< 2 > ( std::istream &  in,
MercuryParticle< 2 > &  part 
)

Definition at line 139 of file MercuryData.h.

140 {
141  std::size_t i;
142  in >> part.position[0] >> part.position[2];
143  part.position[1] = 0;
144 
145  in >> part.velocity[0] >> part.velocity[2];
146  part.velocity[1] = 0;
147 
148  in >> part.radius;
149 
150  in >> part.rotation[1];
151  part.rotation[0] = part.rotation[2] = 0;
152 
153  in >> part.angularV[1];
154  part.angularV[0] = part.angularV[2] = 0;
155 
156  in >> part.speciesID;
157 
158  return in;
159 }
std::size_t speciesID
Definition: MercuryData.h:108