Diffpack Documentation


Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

FieldReader Class Reference

reading of fields from SimRes files. More...

#include <FieldReader.h>

List of all members.

Public Methods

 FieldReader ()
 FieldReader (const String &dataset_name)
 ~FieldReader ()
void setDatasetName (const String &dataset_name)
int getNoFields ()
int getNoGrids ()
void getFieldInfo (int fieldnum, String *header, real *time=NULL, int *dimensions=NULL, String *description=NULL, int *component=NULL, int *maxcomponent=NULL, String *fieldtype=NULL, String *gridtype=NULL)
void getFieldInfo (const String header, int *fieldnum, real *time=NULL, int *dimensions=NULL, String *description=NULL, int *component=NULL, int *maxcomponent=NULL, String *fieldtype=NULL, String *gridtype=NULL)
void getGridInfo (int gridnum, int *checknum=NULL, int *dimensions=NULL, String *gridtype=NULL)
void readField (Handle(Field) &field, int fieldnum=1, String *header=NULL, real *time=NULL, String *description=NULL, int *component=NULL, int *maxcomponent=NULL)


Detailed Description

reading of fields from SimRes files.

NAME: FieldReader - reading of fields from SimRes files

DESCRIPTION:

This class is a low-level tool mainly used from classes "SimResFile" or "SaveSimRes".

The storage format is binary or ASCII. In binary mode we try to use the hardware-independent XDR format if possible (on some systems, problems might arise with xdr and then the "FieldReader" and "FieldWriter" classes can be compiled using a straight (binary) C file).


Constructor & Destructor Documentation

FieldReader::FieldReader ( )
 

The default constructor requires "setDatasetName" to be called, whereas the constructor accepting a "String" argument sets the data set name on its own.

FieldReader::FieldReader ( const String & dataset_name )
 

See documentation of one of the overloaded constructor.

FieldReader::~FieldReader ( )
 


Member Function Documentation

void FieldReader::getFieldInfo ( const String header,
int * fieldnum,
real * time = NULL,
int * dimensions = NULL,
String * description = NULL,
int * component = NULL,
int * maxcomponent = NULL,
String * fieldtype = NULL,
String * gridtype = NULL )
 

See documentation of one of the overloaded functions.

void FieldReader::getFieldInfo ( int fieldnum,
String * header,
real * time = NULL,
int * dimensions = NULL,
String * description = NULL,
int * component = NULL,
int * maxcomponent = NULL,
String * fieldtype = NULL,
String * gridtype = NULL )
 

returns information about the field with the specified field number. The information includes the name of the field, the registered time, the number of dimensions, the number of field components (if the field is part of a vector field), the component number and the field type and grid type.

An overloaded version of the function accepts a header and a time instead of a field number. It will try to locate a matching field, and will set the field number to the field number of the field found. Note that an exact match of the time is not necessary; the closest match will be used. If no match is found, the field number will be set to zero.

void FieldReader::getGridInfo ( int gridnum,
int * checknum = NULL,
int * dimensions = NULL,
String * gridtype = NULL )
 

returns information about a grid specified by its grid number. The information includes the number of dimensions and the grid type.

int FieldReader::getNoFields ( )
 

returns the number of fields in the dataset. This is the number of scalar fields, counting each component of vector fields.

int FieldReader::getNoGrids ( )
 

returns the number of grids in the dataset. This number will be less than or equal to the number of fields in the dataset, Because more than one field can use the same grid.

void FieldReader::readField ( Handle(Field) & field,
int fieldnum = 1,
String * header = NULL,
real * time = NULL,
String * description = NULL,
int * component = NULL,
int * maxcomponent = NULL )
 

reads a field with the specified field number. All information for the field is returned. A handle to a field which is to receive the information is given as a parameter. If the existing field is based on the same grid as the field to be read, the existing grid will be used. Otherwise, the grid will be read from the dataset and will replace the existing.

void FieldReader::setDatasetName ( const String & dataset_name )
 

sets the name of the dataset. When a dataset is already open, it will be closed and the "FieldReader" object will connect to the new dataset instead.


The documentation for this class was generated from the following file:
Copyright © 2003 inuTech GmbH. All rights reserved.