gridripper::io::BDataReader Class Reference

Binary data file reader. More...

#include <BDataReader.h>

List of all members.

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.


Detailed Description

Binary data file reader.

Version:
0.5, 06/10/2009
Since:
GridRipper 0.3, 04/23/2005
Author:
Peter Csizmadia

Constructor & Destructor Documentation

gridripper::io::BDataReader::BDataReader ( const string &  f  )  throw (IOException&)

Constructs a reader for the specified file.

Parameters:
f the file


Member Function Documentation

bool gridripper::io::BDataReader::read (  )  throw (IOException&)

Reads a time slice.

Returns:
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.

Returns:
the time

const string& gridripper::io::BDataReader::getTimeLabel (  )  const [inline]

Gets the name of the time coordinate.

Returns:
the coordinate name

const string& gridripper::io::BDataReader::getXcoordLabel (  )  const [inline]

Gets the name of the space coordinate.

Returns:
the coordinate name

int gridripper::io::BDataReader::getMaxI (  )  const [inline]

Gets the maximum grid point index on the base grid.

Returns:
the maximum grid point index

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.

Returns:
(refinement ratio)^(number of refinement levels)

double gridripper::io::BDataReader::getXMin (  )  const [inline]

Gets the x coordinate of the leftmost grid point.

Returns:
the minimum x coordinate

double gridripper::io::BDataReader::getDeltaX (  )  const [inline]

Gets the grid spacing on the finest subgrid.

Returns:
the smallest grid spacing

int gridripper::io::BDataReader::getNumGridPoints (  )  const [inline]

Gets the total number of grid points on the current time slice.

Returns:
the number of grid points

int gridripper::io::BDataReader::getNumComponents (  )  const [inline]

Gets the number of field components (stored for each grid point).

Returns:
the number of field components

const string& gridripper::io::BDataReader::getComponentName ( int  i  )  const [inline]

Gets the name of a field component.

Parameters:
i component index
Returns:
the component name

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.

Returns:
array of positions

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.

Returns:
the data array

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.

Returns:
the data array

void gridripper::io::BDataReader::getData ( float *  data,
int  pos 
) const

Copies the data into a float array.

Parameters:
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.

Parameters:
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.

Returns:
array of time step counts

const tvalarray<IntArray>& gridripper::io::BDataReader::getLastRegridTimes (  )  [inline]

Gets last regridding time info for the grid tree.

Returns:
array of last regridding times

const tvalarray<double>& gridripper::io::BDataReader::getEnergyLosses (  )  const [inline]

Gets the array of energy losses.

Returns:
array of energy losses


The documentation for this class was generated from the following file:

Generated on Wed Jun 17 18:46:54 2009 for GridRipper by  doxygen 1.5.6