#include <BDataReader.h>
Public Member Functions | |
BDataReader (const string &f) throw (IOException&) | |
Constructs a reader for the specified file. | |
bool | read () throw (IOException&) |
Reads a time slice. | |
double | getTime () const |
Gets the value of the time coordinate on the current slice. | |
const string & | getTimeLabel () const |
Gets the name of the time coordinate. | |
const string & | getXcoordLabel () const |
Gets the name of the space coordinate. | |
int | getMaxI () const |
Gets the maximum grid point index on the base grid. | |
int | getXMultiplier () const |
Gets the scale factor between the finest grid spacing and the base grid spacing. | |
double | getXMin () const |
Gets the x coordinate of the leftmost grid point. | |
double | getDeltaX () const |
Gets the grid spacing on the finest subgrid. | |
int | getNumGridPoints () const |
Gets the total number of grid points on the current time slice. | |
int | getNumComponents () const |
Gets the number of field components (stored for each grid point). | |
const string & | getComponentName (int i) const |
Gets the name of a field component. | |
const tvalarray< int > & | getKxArray () const |
Gets the array of grid point positions. | |
const tvalarray< float > & | getFloatData () const |
Gets the data on the current time slice as a float array. | |
const tvalarray< double > & | getDoubleData () const |
Gets the data on the current time slice as a double array. | |
void | getData (float *data, int pos) const |
Copies the data into a float array. | |
void | getData (double *data, int pos) const |
Copies the data into a double array. | |
const tvalarray< IntArray > & | getTimeStepCounts () |
Gets time step count info for the grid tree. | |
const tvalarray< IntArray > & | getLastRegridTimes () |
Gets last regridding time info for the grid tree. | |
const tvalarray< double > & | getEnergyLosses () const |
Gets the array of energy losses. |
gridripper::io::BDataReader::BDataReader | ( | const string & | f | ) | throw (IOException&) |
Constructs a reader for the specified file.
f | the file |
bool gridripper::io::BDataReader::read | ( | ) | throw (IOException&) |
Reads a time slice.
true
after successful reading, false
at end of file double gridripper::io::BDataReader::getTime | ( | ) | const [inline] |
Gets the value of the time coordinate on the current slice.
const string& gridripper::io::BDataReader::getTimeLabel | ( | ) | const [inline] |
Gets the name of the time coordinate.
const string& gridripper::io::BDataReader::getXcoordLabel | ( | ) | const [inline] |
Gets the name of the space coordinate.
int gridripper::io::BDataReader::getMaxI | ( | ) | const [inline] |
Gets the maximum grid point index on the base grid.
int gridripper::io::BDataReader::getXMultiplier | ( | ) | const [inline] |
Gets the scale factor between the finest grid spacing and the base grid spacing.
This value is 1 for regular grids.
double gridripper::io::BDataReader::getXMin | ( | ) | const [inline] |
Gets the x coordinate of the leftmost grid point.
double gridripper::io::BDataReader::getDeltaX | ( | ) | const [inline] |
Gets the grid spacing on the finest subgrid.
int gridripper::io::BDataReader::getNumGridPoints | ( | ) | const [inline] |
Gets the total number of grid points on the current time slice.
int gridripper::io::BDataReader::getNumComponents | ( | ) | const [inline] |
Gets the number of field components (stored for each grid point).
const string& gridripper::io::BDataReader::getComponentName | ( | int | i | ) | const [inline] |
Gets the name of a field component.
i | component index |
const tvalarray<int>& gridripper::io::BDataReader::getKxArray | ( | ) | const [inline] |
Gets the array of grid point positions.
In case of a regular grid, [0, 1, 2, ..., numGridPoints-1] is returned. In case of mesh refinement, the base grid positions (which are always present in the array) are represented by the numbers 0, xmultiplier, 2*xmultiplier, .., (numGridPoints-1)*xmultiplier. Intermediate values represent refined grid points.
const tvalarray<float>& gridripper::io::BDataReader::getFloatData | ( | ) | const [inline] |
Gets the data on the current time slice as a float array.
The returned array has numGridPoints*numComponents elements if the data is stored in floats. Otherwise, it is empty.
const tvalarray<double>& gridripper::io::BDataReader::getDoubleData | ( | ) | const [inline] |
Gets the data on the current time slice as a double array.
The returned array has numGridPoints*numComponents elements if the data is stored in doubles. Otherwise, it is empty.
void gridripper::io::BDataReader::getData | ( | float * | data, | |
int | pos | |||
) | const |
Copies the data into a float array.
data | the output array | |
pos | starting position in the output array |
void gridripper::io::BDataReader::getData | ( | double * | data, | |
int | pos | |||
) | const |
Copies the data into a double array.
data | the output array | |
pos | starting position in the output array |
const tvalarray<IntArray>& gridripper::io::BDataReader::getTimeStepCounts | ( | ) | [inline] |
Gets time step count info for the grid tree.
const tvalarray<IntArray>& gridripper::io::BDataReader::getLastRegridTimes | ( | ) | [inline] |
Gets last regridding time info for the grid tree.
const tvalarray<double>& gridripper::io::BDataReader::getEnergyLosses | ( | ) | const [inline] |
Gets the array of energy losses.