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
BaseMatrix.h
Go to the documentation of this file.
1 /**
2  * @file BaseMatrix.h
3  * @author Jiri Jaros \n
4  * Faculty of Information Technology\n
5  * Brno University of Technology \n
6  * jarosjir@fit.vutbr.cz
7  *
8  * @brief The header file of the common ancestor of all matrix classes.
9  * A pure abstract class.
10  *
11  * @version kspaceFirstOrder3D 2.15
12  *
13  * @date 11 July 2012, 11:34 (created) \n
14  * 24 September 2014, 15:35 (revised)
15  *
16  * @section License
17  * This file is part of the C++ extension of the k-Wave Toolbox (http://www.k-wave.org).\n
18  * Copyright (C) 2014 Jiri Jaros and Bradley Treeby
19  *
20  * This file is part of k-Wave. k-Wave is free software: you can redistribute it
21  * and/or modify it under the terms of the GNU Lesser General Public License as
22  * published by the Free Software Foundation, either version 3 of the License,
23  * or (at your option) any later version.
24  *
25  * k-Wave is distributed in the hope that it will be useful, but
26  * WITHOUT ANY WARRANTY; without even the implied warranty of
27  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
28  * See the GNU Lesser General Public License for more details.
29  *
30  * You should have received a copy of the GNU Lesser General Public License
31  * along with k-Wave. If not, see <http://www.gnu.org/licenses/>.
32  */
33 
34 
35 #ifndef BASEMATRIX_H
36 #define BASEMATRIX_H
37 
38 
39 #include <Utils/DimensionSizes.h>
40 #include <HDF5/HDF5_File.h>
41 
42 /**
43  * @class TBaseMatrix
44  * @brief Abstract base class, the common ancestor defining the common interface
45  * and allowing derived classes to be allocated, freed and loaded from the file
46  * using the Matrix container.
47  *
48  * @details Abstract base class, the common ancestor defining the common interface
49  * and allowing derived classes to be allocated, freed and loaded from the file
50  * using the Matrix container.
51  */
53 {
54  public:
55  /// Default constructor
57 
58  /// Get dimension sizes of the matrix
59  virtual struct TDimensionSizes GetDimensionSizes() const = 0;
60 
61  /// Get total element count of the matrix
62  virtual size_t GetTotalElementCount() const = 0;
63 
64  /// Get total allocated element count (might differ from the total element count used for the simulation because of e.g. padding).
65  virtual size_t GetTotalAllocatedElementCount() const = 0;
66 
67  /**
68  * @brief Read matrix from the HDF5 file
69  * @details Read matrix from the HDF5 file
70  * @param [in] HDF5_File - Handle to the HDF5 file
71  * @param [in] MatrixName - HDF5 dataset name to read from
72  */
73  virtual void ReadDataFromHDF5File(THDF5_File & HDF5_File,
74  const char * MatrixName) = 0;
75 
76  /**
77  * @brief Write data into the HDF5 file
78  * @details Write data into the HDF5 file
79  * @param [in] HDF5_File - Handle to the HDF5 file
80  * @param [in] MatrixName - HDF5 dataset name to write to
81  * @param [in] CompressionLevel - Compression level for the HDF5 dataset
82  */
83  virtual void WriteDataToHDF5File(THDF5_File & HDF5_File,
84  const char * MatrixName,
85  const size_t CompressionLevel) = 0;
86 
87  /// Destructor
88  virtual ~TBaseMatrix() {};
89 
90 };// end of TBaseMatrix
91 
92 #endif /* BASEMATRIX_H */
Abstract base class, the common ancestor defining the common interface and allowing derived classes t...
Definition: BaseMatrix.h:52
virtual struct TDimensionSizes GetDimensionSizes() const =0
Get dimension sizes of the matrix.
virtual size_t GetTotalElementCount() const =0
Get total element count of the matrix.
The header file containing the HDF5 related classes.
TBaseMatrix()
Default constructor.
Definition: BaseMatrix.h:56
virtual void ReadDataFromHDF5File(THDF5_File &HDF5_File, const char *MatrixName)=0
Read matrix from the HDF5 file.
virtual ~TBaseMatrix()
Destructor.
Definition: BaseMatrix.h:88
The header file containing the structure with 3D dimension sizes.
virtual size_t GetTotalAllocatedElementCount() const =0
Get total allocated element count (might differ from the total element count used for the simulation ...
virtual void WriteDataToHDF5File(THDF5_File &HDF5_File, const char *MatrixName, const size_t CompressionLevel)=0
Write data into the HDF5 file.
Class wrapping the HDF5 routines.
Definition: HDF5_File.h:506
Structure with 4D dimension sizes (3 in space and 1 in time).