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
TBaseOutputHDF5Stream Class Referenceabstract

Abstract base class for output data streams (sampled data). More...

#include <OutputHDF5Stream.h>

Inheritance diagram for TBaseOutputHDF5Stream:
Collaboration diagram for TBaseOutputHDF5Stream:

Public Types

enum  TReductionOperator { roNONE, roRMS, roMAX, roMIN }
 How to aggregate data. More...
 

Public Member Functions

 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...
 
virtual void Create ()=0
 Create a HDF5 stream and allocate data for it.
 
virtual void Reopen ()=0
 Reopen the output stream after restart.
 
virtual void Sample ()=0
 Sample data into buffer, apply reduction or flush to disk - based on a sensor mask.
 
virtual void PostProcess ()
 Apply post-processing on the buffer and flush it to the file. More...
 
virtual void Checkpoint ()=0
 Checkpoint the stream.
 
virtual void Close ()=0
 Close stream (apply post-processing if necessary, flush data and close).
 

Protected Member Functions

 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

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!
 

Static Protected Attributes

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

Abstract base class for output data streams (sampled data).

Definition at line 55 of file OutputHDF5Stream.h.

Member Enumeration Documentation

How to aggregate data
roNONE - store actual data (time series) roRMS - calculate root mean square
roMAX - store maximum roMIN - store minimum

Definition at line 68 of file OutputHDF5Stream.h.

Constructor & Destructor Documentation

TBaseOutputHDF5Stream::TBaseOutputHDF5Stream ( THDF5_File HDF5_File,
const char *  HDF5_RootObjectName,
const TRealMatrix SourceMatrix,
const TReductionOperator  ReductionOp,
float *  BufferToReuse = NULL 
)
inline

Constructor - there is no sensor mask by default! it links the HDF5 dataset, source (sampled matrix) 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_RootObjectName- The root object that stores the sample data (dataset or group)
[in]SourceMatrix- The source matrix (only real matrices are supported)
[in]ReductionOp- Reduction operator
[in]BufferToReuse- An external buffer can be used to line up the grid points

Definition at line 90 of file OutputHDF5Stream.h.

virtual TBaseOutputHDF5Stream::~TBaseOutputHDF5Stream ( )
inlinevirtual

Destructor.

Definition at line 112 of file OutputHDF5Stream.h.

Member Function Documentation

void TBaseOutputHDF5Stream::AllocateMemory ( )
protectedvirtual

Allocate memory using a proper memory alignment.

Warning
This can routine is not used in the base class (should be used in derived ones).

Definition at line 119 of file OutputHDF5Stream.cpp.

Here is the caller graph for this function:

void TBaseOutputHDF5Stream::FreeMemory ( )
protectedvirtual

Free memory.

Warning
This can routine is not used in the base class (should be used in derived ones).

Definition at line 184 of file OutputHDF5Stream.cpp.

Here is the caller graph for this function:

void TBaseOutputHDF5Stream::PostProcess ( )
virtual

Apply post-processing on the buffer. It supposes the elements are independent.

Reimplemented in TWholeDomainOutputHDF5Stream, TCuboidOutputHDF5Stream, and TIndexOutputHDF5Stream.

Definition at line 68 of file OutputHDF5Stream.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:


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