VPTissue Reference Manual
SimPT_Shell::Hdf5File Class Reference

Contains facilities for storing the simulation Mesh to HDF5 files. More...

#include <Hdf5File.h>

Collaboration diagram for SimPT_Shell::Hdf5File:
Collaboration graph

Public Member Functions

 Hdf5File ()
 Creates an empty HDF5 mesh exporter with no file association. More...
 
 Hdf5File (const std::string &file_path)
 Creates a HDF5 mesh a with a file association, provided the HDF5 file has been successfully opened (IsOpen checks this). More...
 
virtual ~Hdf5File ()
 Cleans up HDF5 storage: makes sure files are closed properly.
 
bool Close ()
 Closes the HDF5 file associated with exporter, dissociates it from this exporter object and returns true. More...
 
std::string GetFilePath ()
 Return file path for HDF5 file associated with the exporter object, if any.
 
bool IsOpen ()
 Returns true if exporter is associated with a HDF5 file that has been successfully opened. More...
 
bool Open (const std::string &file_path)
 Creates an HDF5 file and binds the exporter object to it. More...
 
SimPT_Sim::SimState Read (int step_idx=-1)
 
std::vector< std::pair< int, double > > TimeSteps ()
 Reads the time steps contained in the HDF5 file. More...
 
void Write (std::shared_ptr< const SimPT_Sim::Sim > sim)
 Writes the mesh state to the HDF5 file currently associated with exporter object. More...
 

Static Public Member Functions

static std::string GetFileExtension ()
 Return file extension for HDF5 format.
 
static bool HDF5Available ()
 To avoid littering the code with preprocessor conditionals.
 

Detailed Description

Contains facilities for storing the simulation Mesh to HDF5 files.

Definition at line 38 of file Hdf5File.h.

Constructor & Destructor Documentation

SimPT_Shell::Hdf5File::Hdf5File ( )

Creates an empty HDF5 mesh exporter with no file association.

In order to create a new HDF5 file a call to HDF5MeshFile::Open is necessary.

Definition at line 301 of file Hdf5File.cpp.

SimPT_Shell::Hdf5File::Hdf5File ( const std::string &  file_path)

Creates a HDF5 mesh a with a file association, provided the HDF5 file has been successfully opened (IsOpen checks this).

Otherwise the exporter is empty.

Parameters
[in]file_pathpath name of the HDF5 file used for storage.

Definition at line 304 of file Hdf5File.cpp.

References Open().

Here is the call graph for this function:

Member Function Documentation

bool SimPT_Shell::Hdf5File::Close ( )

Closes the HDF5 file associated with exporter, dissociates it from this exporter object and returns true.

Return false if no open file was associated with exporter object.

Returns
Status of operation.

Definition at line 318 of file Hdf5File.cpp.

Referenced by SimPT_Shell::Hdf5Exporter::Export(), SimPT_Shell::Ws::StartupFileHdf5::GetSimState(), Open(), and ~Hdf5File().

Here is the caller graph for this function:

bool SimPT_Shell::Hdf5File::IsOpen ( )

Returns true if exporter is associated with a HDF5 file that has been successfully opened.

Definition at line 339 of file Hdf5File.cpp.

Referenced by SimPT_Shell::Hdf5Exporter::Export(), Open(), TimeSteps(), and ~Hdf5File().

Here is the caller graph for this function:

bool SimPT_Shell::Hdf5File::Open ( const std::string &  file_path)

Creates an HDF5 file and binds the exporter object to it.

If the exporter is currently associated with an open file, that file gets closed first.

Parameters
[in]file_pathpath name of the HDF5 file used for storage.

Definition at line 344 of file Hdf5File.cpp.

References Close(), and IsOpen().

Referenced by Hdf5File().

Here is the call graph for this function:

Here is the caller graph for this function:

vector< pair< int, double > > SimPT_Shell::Hdf5File::TimeSteps ( )

Reads the time steps contained in the HDF5 file.

Returns
Pairs of time step numbers and time stamps.

Definition at line 1096 of file Hdf5File.cpp.

References IsOpen().

Referenced by SimPT_Shell::Ws::StartupFileHdf5::GetTimeSteps().

Here is the call graph for this function:

Here is the caller graph for this function:

void SimPT_Shell::Hdf5File::Write ( std::shared_ptr< const SimPT_Sim::Sim sim)

Writes the mesh state to the HDF5 file currently associated with exporter object.

Does nothing if no open file is currently associated with exporter object.

Parameters
[in]simThe simulation instance whose mesh and state will be written to file

Definition at line 1134 of file Hdf5File.cpp.

Referenced by SimPT_Shell::Hdf5Exporter::Export().

Here is the caller graph for this function:


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