| kspaceFirstOrder3D-OMP 1.1 The C++ implementation of the k-wave toolbox for the time-domain simulation of acoustic wave fields in 3D

- Main Page
- Related Pages
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Files Functions Variables Typedefs Enumerations Friends Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TIndexOutputHDF5Stream Class Reference

Output stream for quantities sampled by an index sensor mask. More...

`#include <OutputHDF5Stream.h>`

Inheritance diagram for TIndexOutputHDF5Stream:
[legend]
Collaboration diagram for TIndexOutputHDF5Stream:
[legend]

## Public Member Functions
| TIndexOutputHDF5Stream (THDF5_File &HDF5_File, const char *HDF5_ObjectName, const TRealMatrix &SourceMatrix, const TIndexMatrix &SensorMask, const TReductionOperator ReductionOp, float *BufferToReuse=NULL)
| Constructor - links the HDF5 dataset, SourceMatrix, and SensorMask together. More...
virtual | ~TIndexOutputHDF5Stream ()
| Destructor. More...
virtual void | Create ()
| Create a HDF5 stream and allocate data for it. More...
virtual void | Reopen ()
| Reopen the output stream after restart and reload data. More...
virtual void | Sample ()
| Sample data into buffer, apply reduction or flush to disk - based on a sensor mask. More...
virtual void | PostProcess ()
| Apply post-processing on the buffer and flush it to the file. More...
virtual void | Checkpoint ()
| Checkpoint the stream. More...
virtual void | Close ()
| Close stream (apply post-processing if necessary, flush data and close). More...
Public Member Functions inherited from TBaseOutputHDF5Stream
| TBaseOutputHDF5Stream (THDF5_File &HDF5_File, const char *HDF5_RootObjectName, const TRealMatrix &SourceMatrix, const TReductionOperator ReductionOp, float *BufferToReuse=NULL)
| Constructor - there is no sensor mask by default! More...
virtual | ~TBaseOutputHDF5Stream ()
| Destructor. More...

## Protected Member Functions
virtual void | FlushBufferToFile ()
| Flush the buffer to the file. More...
Protected Member Functions inherited from TBaseOutputHDF5Stream
| TBaseOutputHDF5Stream ()
| Default constructor not allowed.
| TBaseOutputHDF5Stream (const TBaseOutputHDF5Stream &src)
| Copy constructor not allowed.
TBaseOutputHDF5Stream & | operator= (const TBaseOutputHDF5Stream &src)
| Operator = not allowed (we don't want any data movements).
virtual void | AllocateMemory ()
| A generic function to allocate memory - not used in the base class. More...
virtual void | FreeMemory ()
| A generic function to free memory - not used in the base class. More...

## Protected Attributes
const TIndexMatrix & | SensorMask
| Sensor mask to sample data.
hid_t | HDF5_DatasetId
| Handle to a HDF5 dataset.
size_t | SampledTimeStep
| Time step to store (N/A for aggregated).
Protected Attributes inherited from TBaseOutputHDF5Stream
THDF5_File & | HDF5_File
| HDF5 file handle.
char * | HDF5_RootObjectName
| Dataset name.
const TRealMatrix & | SourceMatrix
| Source matrix to be sampled.
const TReductionOperator | ReductionOp
| Reduction operator.
bool | BufferReuse
| if true, the container reuses e.g. Temp_1_RS3D, Temp_2_RS3D, Temp_3_RS3D.
size_t | BufferSize
| Buffer size.
float * | StoreBuffer
| Temporary buffer for store - only if Buffer Reuse = false!

## Additional Inherited Members
Public Types inherited from TBaseOutputHDF5Stream
enum | TReductionOperator { roNONE, roRMS, roMAX, roMIN }
| How to aggregate data. More...
Static Protected Attributes inherited from TBaseOutputHDF5Stream
static const size_t | ChunkSize_4MB = 1048576
| chunk size of 4MB in number of float elements.
static const size_t | MinGridpointsToSampleInParallel = 1048576
| The minimum number of elements to start sampling in parallel (4MB).

## Detailed Description

Output stream for quantities sampled by an index sensor mask. This class writes data to a single dataset in a root group of the HDF5 file (time-series as well as aggregations).

Definition at line 181 of file OutputHDF5Stream.h.

## Constructor & Destructor Documentation

TIndexOutputHDF5Stream::TIndexOutputHDF5Stream | ( | THDF5_File & | HDF5_File,
|  | const char * | HDF5_ObjectName,
|  | const TRealMatrix & | SourceMatrix,
|  | const TIndexMatrix & | SensorMask,
|  | const TReductionOperator | ReductionOp,
|  | float * | BufferToReuse = `NULL`
| ) |  |

Constructor - links the HDF5 dataset, source (sampled matrix), Sensor mask and the reduction operator together. The constructor DOES NOT allocate memory because the size of the sensor mask is not known at the time the instance of the class is being created.

Parameters

  [in] | HDF5_File | - Handle to the HDF5 (output) file
  [in] | HDF5_ObjectName | - The dataset's name (index based sensor data is store in a single dataset)
  [in] | SourceMatrix | - The source matrix (only real matrices are supported)
  [in] | SensorMask | - Index based sensor mask
  [in] | ReductionOp | - Reduction operator
  [in] | BufferToReuse | - An external buffer can be used to line up the grid points

Definition at line 216 of file OutputHDF5Stream.cpp.

TIndexOutputHDF5Stream::~TIndexOutputHDF5Stream | ( |  | ) |
| virtual

Destructor. if the file is still opened, it applies the post processing and flush the data. Then, the object memory is freed and the object destroyed.

Definition at line 237 of file OutputHDF5Stream.cpp.

Here is the call graph for this function:

## Member Function Documentation

void TIndexOutputHDF5Stream::Checkpoint | ( |  | ) |
| virtual

Checkpoint the stream and close.

Implements TBaseOutputHDF5Stream.

Definition at line 418 of file OutputHDF5Stream.cpp.

Here is the call graph for this function:

void TIndexOutputHDF5Stream::Close | ( |  | ) |
| virtual

Close stream (apply post-processing if necessary, flush data and close).

Implements TBaseOutputHDF5Stream.

Definition at line 429 of file OutputHDF5Stream.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void TIndexOutputHDF5Stream::Create | ( |  | ) |
| virtual

Create a HDF5 stream, create a dataset, and allocate data for it.

Implements TBaseOutputHDF5Stream.

Definition at line 250 of file OutputHDF5Stream.cpp.

Here is the call graph for this function:

void TIndexOutputHDF5Stream::FlushBufferToFile | ( |  | ) |
| protected virtual

Flush the buffer down to the file at the actual position.

Definition at line 450 of file OutputHDF5Stream.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void TIndexOutputHDF5Stream::PostProcess | ( |  | ) |
| virtual

Apply post-processing on the buffer and flush it to the file.

Reimplemented from TBaseOutputHDF5Stream.

Definition at line 405 of file OutputHDF5Stream.cpp.

Here is the call graph for this function:

void TIndexOutputHDF5Stream::Reopen | ( |  | ) |
| virtual

Reopen the output stream after restart.

Implements TBaseOutputHDF5Stream.

Definition at line 299 of file OutputHDF5Stream.cpp.

Here is the call graph for this function:

void TIndexOutputHDF5Stream::Sample | ( |  | ) |
| virtual

Sample grid points, line them up in the buffer an flush to the disk unless a reduction operator is applied.

Implements TBaseOutputHDF5Stream.

Definition at line 339 of file OutputHDF5Stream.cpp.

Here is the call graph for this function:

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

- MatrixClasses/OutputHDF5Stream.h
- MatrixClasses/OutputHDF5Stream.cpp