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

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

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
36 #include <OutputHDF5Streams/BaseOutputHDF5Stream.h>
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 */
44 class TWholeDomainOutputHDF5Stream : public TBaseOutputHDF5Stream
45 {
46 public:
47 /// Constructor.
48 TWholeDomainOutputHDF5Stream(THDF5_File& file,
49 TMatrixName& datasetName,
50 TRealMatrix& sourceMatrix,
51 const TReduceOperator reduceOp);
52
53 /// Destructor.
54 virtual ~TWholeDomainOutputHDF5Stream();
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).
85 size_t sampledTimeStep;
86 };// end of TWholeDomainOutputHDF5Stream
87 //--------------------------------------------------------------------------------------------------
88
89 #endif /* WHOLEDOMAINOUTPUTHDF5STREAM_H */
90
TWholeDomainOutputHDF5Stream::FlushBufferToFile
virtual void FlushBufferToFile()
Flush the buffer to the file.
Definition: WholeDomainOutputHDF5Stream.cpp:271
TBaseOutputHDF5Stream::file
THDF5_File & file
HDF5 file handle.
Definition: BaseOutputHDF5Stream.h:115
TWholeDomainOutputHDF5Stream::Reopen
virtual void Reopen()
Reopen the output stream after restart and reload data.
Definition: WholeDomainOutputHDF5Stream.cpp:113
TWholeDomainOutputHDF5Stream::FlushRaw
virtual void FlushRaw()
Flush data to disk (from raw streams only) - empty routine (no overlapping implemented) ...
Definition: WholeDomainOutputHDF5Stream.h:66
TWholeDomainOutputHDF5Stream
Output stream for quantities sampled in the whole domain.
Definition: WholeDomainOutputHDF5Stream.h:44
BaseOutputHDF5Stream.h
The header file of the class saving RealMatrix data into the output HDF5 file.
TWholeDomainOutputHDF5Stream::Close
virtual void Close()
Close stream (apply post-processing if necessary, flush data and close).
Definition: WholeDomainOutputHDF5Stream.cpp:250
TBaseOutputHDF5Stream::reduceOp
const TReduceOperator reduceOp
Reduce operator.
Definition: BaseOutputHDF5Stream.h:126
TWholeDomainOutputHDF5Stream::Sample
virtual void Sample()
Sample data (copy from GPU memory and then flush - no overlapping implemented!)
Definition: WholeDomainOutputHDF5Stream.cpp:154
TMatrixName
const std::string TMatrixName
Datatype for matrix names.
Definition: MatrixNames.h:45
TBaseOutputHDF5Stream::sourceMatrix
const TRealMatrix & sourceMatrix
Source matrix to be sampled.
Definition: BaseOutputHDF5Stream.h:121
TWholeDomainOutputHDF5Stream::~TWholeDomainOutputHDF5Stream
virtual ~TWholeDomainOutputHDF5Stream()
Destructor.
Definition: WholeDomainOutputHDF5Stream.cpp:71
TWholeDomainOutputHDF5Stream::TWholeDomainOutputHDF5Stream
TWholeDomainOutputHDF5Stream(THDF5_File &file, TMatrixName &datasetName, TRealMatrix &sourceMatrix, const TReduceOperator reduceOp)
Constructor.
Definition: WholeDomainOutputHDF5Stream.cpp:53
TWholeDomainOutputHDF5Stream::sampledTimeStep
size_t sampledTimeStep
Time step to store (N/A for aggregated).
Definition: WholeDomainOutputHDF5Stream.h:85
TBaseOutputHDF5Stream::TReduceOperator
TReduceOperator
How to aggregate data.
Definition: BaseOutputHDF5Stream.h:54
TBaseOutputHDF5Stream
Abstract base class for output data streams (sampled data).
Definition: BaseOutputHDF5Stream.h:46
TRealMatrix
The class for real matrices.
Definition: RealMatrix.h:45
TWholeDomainOutputHDF5Stream::Checkpoint
virtual void Checkpoint()
Definition: WholeDomainOutputHDF5Stream.cpp:237
TWholeDomainOutputHDF5Stream::PostProcess
virtual void PostProcess()
Apply post-processing on the buffer and flush it to the file.
Definition: WholeDomainOutputHDF5Stream.cpp:217
TWholeDomainOutputHDF5Stream::dataset
hid_t dataset
Handle to a HDF5 dataset.
Definition: WholeDomainOutputHDF5Stream.h:82
TWholeDomainOutputHDF5Stream::Create
virtual void Create()
Create a HDF5 stream and allocate data for it.
Definition: WholeDomainOutputHDF5Stream.cpp:84
THDF5_File
Class wrapping the HDF5 routines.
Definition: HDF5_File.h:500