kspaceFirstOrder3D-OMP
1.1
The C++ implementation of the k-wave toolbox for the time-domain simulation of acoustic wave fields in 3D
|
Output stream for quantities sampled by a cuboid corner sensor mask. More...
#include <OutputHDF5Stream.h>
Classes | |
struct | TCuboidInfo |
This structure information about a HDF5 dataset (one cuboid). Namely, its HDF5_ID, Starting position in a lineup buffer. More... | |
Public Member Functions | |
TCuboidOutputHDF5Stream (THDF5_File &HDF5_File, const char *HDF5_GroupName, const TRealMatrix &SourceMatrix, const TIndexMatrix &SensorMask, const TReductionOperator ReductionOp, float *BufferToReuse=NULL) | |
Constructor - links the HDF5 File, SourceMatrix, and SensorMask together. More... | |
virtual | ~TCuboidOutputHDF5Stream () |
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 - 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 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 hid_t | CreateCuboidDataset (const size_t Index) |
Create a new dataset for a given cuboid specified by index (order). More... | |
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_GroupId |
Handle to a HDF5 dataset. | |
std::vector< TCuboidInfo > | CuboidsInfo |
vector keeping handles and positions of all cuboids | |
size_t | SampledTimeStep |
Timestep 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). | |
Output stream for quantities sampled by a cuboid corner sensor mask. This class writes data into separated datasets (one per cuboid) under a given dataset in the HDF5 file (time-series as well as aggregations).
Definition at line 239 of file OutputHDF5Stream.h.
TCuboidOutputHDF5Stream::TCuboidOutputHDF5Stream | ( | THDF5_File & | HDF5_File, |
const char * | HDF5_GroupName, | ||
const TRealMatrix & | SourceMatrix, | ||
const TIndexMatrix & | SensorMask, | ||
const TReductionOperator | ReductionOp, | ||
float * | BufferToReuse = NULL |
||
) |
Constructor - links the HDF5 dataset, SourceMatrix, and SensorMask together.
[in] | HDF5_File | - HDF5 file to write the output to |
[in] | HDF5_GroupName | - The name of the HDF5 group. This group contains datasets for particular cuboids |
[in] | SourceMatrix | - Source matrix to be sampled |
[in] | SensorMask | - Sensor mask with the cuboid coordinates |
[in] | ReductionOp | - Reduction operator |
[in] | BufferToReuse | - If there is a memory space to be reused, provide a pointer |
Definition at line 480 of file OutputHDF5Stream.cpp.
|
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 501 of file OutputHDF5Stream.cpp.
|
virtual |
Checkpoint the stream.
Implements TBaseOutputHDF5Stream.
Definition at line 811 of file OutputHDF5Stream.cpp.
|
virtual |
Close stream (apply post-processing if necessary, flush data, close datasets and the group).
Implements TBaseOutputHDF5Stream.
Definition at line 823 of file OutputHDF5Stream.cpp.
|
virtual |
Create a HDF5 stream and allocate data for it. It also creates a HDF5 group with particular datasets (one per cuboid).
Implements TBaseOutputHDF5Stream.
Definition at line 515 of file OutputHDF5Stream.cpp.
|
protectedvirtual |
Create a new dataset for a given cuboid specified by index (order).
[in] | Index | - Index of the cuboid in the sensor mask |
Definition at line 853 of file OutputHDF5Stream.cpp.
|
protectedvirtual |
Flush the buffer to the file (to multiple datasets if necessary).
Definition at line 907 of file OutputHDF5Stream.cpp.
|
virtual |
Apply post-processing on the buffer and flush it to the file.
Reimplemented from TBaseOutputHDF5Stream.
Definition at line 799 of file OutputHDF5Stream.cpp.
|
virtual |
Reopen the output stream after restart and reload data.
Implements TBaseOutputHDF5Stream.
Definition at line 551 of file OutputHDF5Stream.cpp.
|
virtual |
Sample data into buffer and apply reduction, or flush to disk - based on a sensor mask.
Implements TBaseOutputHDF5Stream.
Definition at line 614 of file OutputHDF5Stream.cpp.