kspaceFirstOrder3D-CUDA  1.1
The CUDA/C++ implementation of the k-wave toolbox for the time-domain simulation of acoustic wave fields in 3D
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
WholeDomainOutputHDF5Stream.h
Go to the documentation of this file.
1 /**
2  * @file WholeDomainOutputHDF5Stream.h
3  *
4  * @author Jiri Jaros \n
5  * Faculty of Information Technology \n
6  * Brno University of Technology \n
7  * jarosjir@fit.vutbr.cz
8  *
9  * @brief The header file of the class saving whole RealMatrix into the output HDF5 file,
10  * e.g. p_max_all.
11  *
12  * @version kspaceFirstOrder3D 3.4
13  *
14  * @date 28 August 2014, 10:20 (created)
15  * 26 July 2016, 14:03 (revised)
16  *
17  * @section License
18  * This file is part of the C++ extension of the k-Wave Toolbox
19  * (http://www.k-wave.org).\n Copyright (C) 2016 Jiri Jaros and Bradley Treeby.
20  *
21  * This file is part of the k-Wave. k-Wave is free software: you can redistribute it and/or modify
22  * it under the terms of the GNU Lesser General Public License as published by the Free Software
23  * Foundation, either version 3 of the License, or (at your option) any later version.
24  *
25  * k-Wave is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
26  * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
27  * General Public License for more details.
28  *
29  * You should have received a copy of the GNU Lesser General Public License along with k-Wave.
30  * If not, see http://www.gnu.org/licenses/.
31  */
32 
33 #ifndef WHOLE_DOMAIN_OUTPUT_HDF5_STREAM_H
34 #define WHOLE_DOMAIN_OUTPUT_HDF5_STREAM_H
35 
37 
38 /**
39  * @class TWholeDomainOutputHDF5Stream
40  * @brief Output stream for quantities sampled in the whole domain.
41  * @details Output stream for quantities sampled in the whole domain.
42  * The data is stored in a single dataset (aggregated quantities only).
43  */
45 {
46  public:
47  /// Constructor.
49  TMatrixName& datasetName,
52 
53  /// Destructor.
55 
56  /// Create a HDF5 stream and allocate data for it.
57  virtual void Create();
58 
59  /// Reopen the output stream after restart and reload data.
60  virtual void Reopen();
61 
62  /// Sample data (copy from GPU memory and then flush - no overlapping implemented!)
63  virtual void Sample();
64 
65  /// Flush data to disk (from raw streams only) - empty routine (no overlapping implemented)
66  virtual void FlushRaw() {};
67 
68  /// Apply post-processing on the buffer and flush it to the file.
69  virtual void PostProcess();
70 
71  //Checkpoint the stream and close.
72  virtual void Checkpoint();
73 
74  /// Close stream (apply post-processing if necessary, flush data and close).
75  virtual void Close();
76 
77  protected:
78  /// Flush the buffer to the file.
79  virtual void FlushBufferToFile();
80 
81  /// Handle to a HDF5 dataset.
82  hid_t dataset;
83 
84  /// Time step to store (N/A for aggregated).
86 };// end of TWholeDomainOutputHDF5Stream
87 //--------------------------------------------------------------------------------------------------
88 
89 #endif /* WHOLEDOMAINOUTPUTHDF5STREAM_H */
90 
virtual void FlushBufferToFile()
Flush the buffer to the file.
THDF5_File & file
HDF5 file handle.
virtual void Reopen()
Reopen the output stream after restart and reload data.
virtual void FlushRaw()
Flush data to disk (from raw streams only) - empty routine (no overlapping implemented) ...
Output stream for quantities sampled in the whole domain.
The header file of the class saving RealMatrix data into the output HDF5 file.
virtual void Close()
Close stream (apply post-processing if necessary, flush data and close).
const TReduceOperator reduceOp
Reduce operator.
virtual void Sample()
Sample data (copy from GPU memory and then flush - no overlapping implemented!)
const std::string TMatrixName
Datatype for matrix names.
Definition: MatrixNames.h:45
const TRealMatrix & sourceMatrix
Source matrix to be sampled.
virtual ~TWholeDomainOutputHDF5Stream()
Destructor.
TWholeDomainOutputHDF5Stream(THDF5_File &file, TMatrixName &datasetName, TRealMatrix &sourceMatrix, const TReduceOperator reduceOp)
Constructor.
size_t sampledTimeStep
Time step to store (N/A for aggregated).
TReduceOperator
How to aggregate data.
Abstract base class for output data streams (sampled data).
The class for real matrices.
Definition: RealMatrix.h:45
virtual void PostProcess()
Apply post-processing on the buffer and flush it to the file.
hid_t dataset
Handle to a HDF5 dataset.
virtual void Create()
Create a HDF5 stream and allocate data for it.
Class wrapping the HDF5 routines.
Definition: HDF5_File.h:500