kspaceFirstOrder3D-OMP  1.1
The C++ implementation of the k-wave toolbox for the time-domain simulation of acoustic wave fields in 3D
 All Classes Files Functions Variables Typedefs Enumerations Friends Pages
TWholeDomainOutputHDF5Stream Class Reference

Output stream for quantities sampled in the whole domain. More...

#include <OutputHDF5Stream.h>

Inheritance diagram for TWholeDomainOutputHDF5Stream:
Collaboration diagram for TWholeDomainOutputHDF5Stream:

Public Member Functions

 TWholeDomainOutputHDF5Stream (THDF5_File &HDF5_File, const char *HDF5_DatasetName, const TRealMatrix &SourceMatrix, const TReductionOperator ReductionOp, float *BufferToReuse=NULL)
 Constructor - links the HDF5 File, SourceMatrix, and SensorMask together. More...
 
virtual ~TWholeDomainOutputHDF5Stream ()
 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 and apply reduction, or flush to disk (no sensor mask here). More...
 
virtual void PostProcess ()
 Apply post-processing on the buffer and flush it to the file. More...
 
virtual void Checkpoint ()
 Checkpoint the stream and close. 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.
 
TBaseOutputHDF5Streamoperator= (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

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_FileHDF5_File
 HDF5 file handle.
 
char * HDF5_RootObjectName
 Dataset name.
 
const TRealMatrixSourceMatrix
 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 in the whole domain. The data is stored in a single dataset (aggregated quantities only).

Definition at line 315 of file OutputHDF5Stream.h.

Constructor & Destructor Documentation

TWholeDomainOutputHDF5Stream::TWholeDomainOutputHDF5Stream ( THDF5_File HDF5_File,
const char *  HDF5_DatasetName,
const TRealMatrix SourceMatrix,
const TReductionOperator  ReductionOp,
float *  BufferToReuse = NULL 
)

Constructor - links the HDF5 dataset and SourceMatrix.

Parameters
[in]HDF5_File- HDF5 file to write the output to
[in]HDF5_DatasetName- The name of the HDF5 group. This group contains datasets for particular cuboids
[in]SourceMatrix- Source matrix to be sampled
[in]ReductionOp- Reduction operator
[in]BufferToReuse- If there is a memory space to be reused, provide a pointer

Definition at line 947 of file OutputHDF5Stream.cpp.

TWholeDomainOutputHDF5Stream::~TWholeDomainOutputHDF5Stream ( )
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 965 of file OutputHDF5Stream.cpp.

Here is the call graph for this function:

Member Function Documentation

void TWholeDomainOutputHDF5Stream::Checkpoint ( )
virtual

Checkpoint the stream

Implements TBaseOutputHDF5Stream.

Definition at line 1130 of file OutputHDF5Stream.cpp.

Here is the call graph for this function:

void TWholeDomainOutputHDF5Stream::Close ( )
virtual

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

Implements TBaseOutputHDF5Stream.

Definition at line 1140 of file OutputHDF5Stream.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void TWholeDomainOutputHDF5Stream::Create ( )
virtual

Create a HDF5 stream for the whole domain and allocate data for it.

Implements TBaseOutputHDF5Stream.

Definition at line 976 of file OutputHDF5Stream.cpp.

Here is the call graph for this function:

void TWholeDomainOutputHDF5Stream::FlushBufferToFile ( )
protectedvirtual

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

Definition at line 1162 of file OutputHDF5Stream.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void TWholeDomainOutputHDF5Stream::PostProcess ( )
virtual

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

Reimplemented from TBaseOutputHDF5Stream.

Definition at line 1118 of file OutputHDF5Stream.cpp.

Here is the call graph for this function:

void TWholeDomainOutputHDF5Stream::Reopen ( )
virtual

Reopen the output stream after restart and reload data.

Implements TBaseOutputHDF5Stream.

Definition at line 1007 of file OutputHDF5Stream.cpp.

Here is the call graph for this function:

void TWholeDomainOutputHDF5Stream::Sample ( )
virtual

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

Implements TBaseOutputHDF5Stream.

Definition at line 1042 of file OutputHDF5Stream.cpp.

Here is the call graph for this function:


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