Diffpack Documentation


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

SimResFile Class Reference

simplified interface to FieldWriter/Reader. More...

#include <SimResFile.h>

List of all members.

Public Methods

 SimResFile ()
 SimResFile (const String &filename, const bool append=false)
 ~SimResFile ()
void open (const String &filename, const bool append=false)
String getDatasetName () const
bool ok () const
void checkState () const
void setStorageMode (Format_type field_format, Format_type grid_format)
void getStorageMode (Format_type &field_format, Format_type &grid_format)
int getNoFields ()
int locateField (const String &fieldname, real &time, int &nsd, String &fieldtype, int &component, int &maxcomponent)
int locateField (const int fieldnum, String &fieldname, real &time, int &nsd, String &fieldtype, int &component, int &maxcomponent)
int write (Field &field, const String &fieldname, const real time, const String &description, const int component=1, const int maxcomponent=1)
bool read (Handle(Field) &field, const String &fieldname, real &time, String &fieldtype, int &component, int &maxcomponent)
bool read (Handle(Field) &field, const int fieldnum, String &fieldname, real &time, String &fieldtype, int &component, int &maxcomponent)
int write (Fields &fields, const String &fieldname, const real time, const String &description)
bool read (Handle(Fields) &fields, const String &fieldname, real &time, String &fieldtype)
bool read (Handle(Fields) &fields, const int fieldnum, String &fieldname, real &time, String &fieldtype)

Static Public Methods

void writeField (FieldFV &fv, SimResFile &file, const String &fieldname, const real time, const String &description)
void writeFields (FieldsFV &fvs, SimResFile &file, const String &fieldname, const real time, const String &description)
void writeField (FieldFE &fe, SimResFile &file, const String &fieldname, const real time, const String &description)
void writeFields (FieldsFE &fes, SimResFile &file, const String &fieldname, const real time, const String &description)
void writeField (FieldPiWisConst &fsd, SimResFile &file, const String &fieldname, const real time, const String &description)
void writeFields (FieldsPiWisConst &fsds, SimResFile &file, const String &fieldname, const real time, const String &description)
void writeField (FieldLattice &fd, SimResFile &file, const String &fieldname, const real time, const String &description)
void writeFields (FieldsLattice &fds, SimResFile &file, const String &fieldname, const real time, const String &description)
bool readField (FieldFV &fv, SimResFile &file, const String &fieldname, real &time, bool enable_time_mismatch_warning=false)
bool readFields (FieldsFV &fvs, SimResFile &file, const String &fieldname, real &time, bool enable_time_mismatch_warning=false)
bool readFields (FieldsFV &fes, SimResFile &file, const int fieldnum)
bool readField (FieldFE &fe, SimResFile &file, const String &fieldname, real &time, bool enable_time_mismatch_warning=false)
bool readFields (FieldsFE &fes, SimResFile &file, const String &fieldname, real &time, bool enable_time_mismatch_warning=false)
bool readFields (FieldsFE &fes, SimResFile &file, const int fieldnum)
bool readField (FieldPiWisConst &fsd, SimResFile &file, const String &fieldname, real &time, bool enable_time_mismatch_warning=false)
bool readFields (FieldsPiWisConst &fsds, SimResFile &file, const String &fieldname, real &time, bool enable_time_mismatch_warning=false)
bool readFields (FieldsPiWisConst &fsds, SimResFile &file, const int fieldnum)


Detailed Description

simplified interface to FieldWriter/Reader.

NAME: SimResFile - simplified interface to FieldWriter/Reader

DESCRIPTION:

The class serves as an interface to the more low level classes "FieldWriter" and "FieldReader" for storing and reading general fields. The interface consists mainly of a "read" and "write" function (in class "SimResFile"). Reading and writing through these functions requires a "SimResFile" object, tied to a dataset, and specification of the field name, the time, or alternatively, the field number. Each field that is stored in SimRes format is given a unique number, which serves as an identification of the field. The "read" and "write" work with base class field objects, "Field" or "Fields". If the field type is known (e.g. "FieldFE", "FieldLattice" etc), simpler interfaces to "read" and "write" are offered throught the static functions "readField(s)" and "writeField(s)".


Constructor & Destructor Documentation

SimResFile::SimResFile ( )
 

The default constructor requires "open" to be called, whereas the constructor accepting a "String" argument opens the specified file implicitly..

SimResFile::SimResFile ( const String & filename,
const bool append = false )
 

See documentation of one of the overloaded constructor.

SimResFile::~SimResFile ( )
 


Member Function Documentation

void SimResFile::checkState ( ) const
 

String SimResFile::getDatasetName ( ) const
 

returns the name of the current dataset. The dataset name is set by calling "open".

int SimResFile::getNoFields ( )
 

void SimResFile::getStorageMode ( Format_type & field_format,
Format_type & grid_format )
 

int SimResFile::locateField ( const int fieldnum,
String & fieldname,
real & time,
int & nsd,
String & fieldtype,
int & component,
int & maxcomponent )
 

See documentation of one of the overloaded functions.

int SimResFile::locateField ( const String & fieldname,
real & time,
int & nsd,
String & fieldtype,
int & component,
int & maxcomponent )
 

locates field given by fieldname (and time), or by a specific field number. If more than one field match the given name, the one nearest in time will be returned. All non-const parameters will be returned with the actual values for the field found. The "fieldtype" parameter reflects the class name of the field ("FieldFE", "FieldLattice" etc) in the "Field" hierarchy. The "component" integer reflects the number of a component in a vector with "maxcomponent" components in total. For scalar fields, "component" and "maxcomponent" are always 1.

bool SimResFile::ok ( ) const
 

void SimResFile::open ( const String & filename,
const bool append = false )
 

connects the "SimResFile" object to a dataset. No files are opened, the filename is just set. Files are opened only when required and closed again as soon a field is stored. In this way, files are not destroyed if the computer stops during a simulation.

bool SimResFile::read ( Handle(Fields) & fields,
const int fieldnum,
String & fieldname,
real & time,
String & fieldtype )
 

See documentation of one of the overloaded functions.

bool SimResFile::read ( Handle(Fields) & fields,
const String & fieldname,
real & time,
String & fieldtype )
 

See documentation of one of the overloaded functions.

bool SimResFile::read ( Handle(Field) & field,
const int fieldnum,
String & fieldname,
real & time,
String & fieldtype,
int & component,
int & maxcomponent )
 

See documentation of one of the overloaded functions.

bool SimResFile::read ( Handle(Field) & field,
const String & fieldname,
real & time,
String & fieldtype,
int & component,
int & maxcomponent )
 

store and load fields where the field type ("FieldFE", "FieldLattice", "FieldPiWisConst" etc) is unknown or free. If the field type is known, the static functions (listed outside the class) "writeField(s)" and "readField(s)" are easier to use because they have fewer arguments. The "component" integer reflects the number of a component in a vector with "maxcomponent" components in total. See the "locateField" function for documentation on how the fields is located by the "read" function.

static bool SimResFile::readField ( FieldPiWisConst & fsd,
SimResFile & file,
const String & fieldname,
real & time,
bool enable_time_mismatch_warning = false ) [static]
 

See documentation of one of the overloaded functions.

static bool SimResFile::readField ( FieldFE & fe,
SimResFile & file,
const String & fieldname,
real & time,
bool enable_time_mismatch_warning = false ) [static]
 

See documentation of one of the overloaded functions.

static bool SimResFile::readField ( FieldFV & fv,
SimResFile & file,
const String & fieldname,
real & time,
bool enable_time_mismatch_warning = false ) [static]
 

see "writeField".

static bool SimResFile::readFields ( FieldsPiWisConst & fsds,
SimResFile & file,
const int fieldnum ) [static]
 

See documentation of one of the overloaded functions.

static bool SimResFile::readFields ( FieldsPiWisConst & fsds,
SimResFile & file,
const String & fieldname,
real & time,
bool enable_time_mismatch_warning = false ) [static]
 

See documentation of one of the overloaded functions.

static bool SimResFile::readFields ( FieldsFE & fes,
SimResFile & file,
const int fieldnum ) [static]
 

See documentation of one of the overloaded functions.

static bool SimResFile::readFields ( FieldsFE & fes,
SimResFile & file,
const String & fieldname,
real & time,
bool enable_time_mismatch_warning = false ) [static]
 

See documentation of one of the overloaded functions.

static bool SimResFile::readFields ( FieldsFV & fes,
SimResFile & file,
const int fieldnum ) [static]
 

See documentation of one of the overloaded functions.

static bool SimResFile::readFields ( FieldsFV & fvs,
SimResFile & file,
const String & fieldname,
real & time,
bool enable_time_mismatch_warning = false ) [static]
 

see "writeField".

void SimResFile::setStorageMode ( Format_type field_format,
Format_type grid_format )
 

int SimResFile::write ( Fields & fields,
const String & fieldname,
const real time,
const String & description )
 

See documentation of one of the overloaded functions.

int SimResFile::write ( Field & field,
const String & fieldname,
const real time,
const String & description,
const int component = 1,
const int maxcomponent = 1 )
 

static void SimResFile::writeField ( FieldLattice & fd,
SimResFile & file,
const String & fieldname,
const real time,
const String & description ) [static]
 

See documentation of one of the overloaded functions.

static void SimResFile::writeField ( FieldPiWisConst & fsd,
SimResFile & file,
const String & fieldname,
const real time,
const String & description ) [static]
 

See documentation of one of the overloaded functions.

static void SimResFile::writeField ( FieldFE & fe,
SimResFile & file,
const String & fieldname,
const real time,
const String & description ) [static]
 

See documentation of one of the overloaded functions.

static void SimResFile::writeField ( FieldFV & fv,
SimResFile & file,
const String & fieldname,
const real time,
const String & description ) [static]
 

these are simplified interfaces to "SimResFile read" and "SimResFile write". The simplified functions are typically used if the field type is known (e.g. "FieldFE" or "FieldLattice"). If the field type is unknown, one must use "SimResFile read" and "SimResFile::write".

static void SimResFile::writeFields ( FieldsLattice & fds,
SimResFile & file,
const String & fieldname,
const real time,
const String & description ) [static]
 

See documentation of one of the overloaded functions.

static void SimResFile::writeFields ( FieldsPiWisConst & fsds,
SimResFile & file,
const String & fieldname,
const real time,
const String & description ) [static]
 

See documentation of one of the overloaded functions.

static void SimResFile::writeFields ( FieldsFE & fes,
SimResFile & file,
const String & fieldname,
const real time,
const String & description ) [static]
 

See documentation of one of the overloaded functions.

static void SimResFile::writeFields ( FieldsFV & fvs,
SimResFile & file,
const String & fieldname,
const real time,
const String & description ) [static]
 

see "writeField".


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