kspaceFirstOrder3D-OMP
1.2
The C++ implementation of the k-wave toolbox for the time-domain simulation of acoustic wave fields in 3D
|
Class implementing the matrix container. More...
#include <MatrixContainer.h>
Public Member Functions | |
MatrixContainer () | |
Constructor. More... | |
MatrixContainer (const MatrixContainer &)=delete | |
Copy constructor is not allowed. | |
~MatrixContainer () | |
Destructor. More... | |
MatrixContainer & | operator= (const MatrixContainer &)=delete |
Operator = is not allowed. | |
size_t | size () const |
Get the number of matrices in the container. More... | |
bool | empty () const |
Is the container empty? More... | |
MatrixRecord & | operator[] (const MatrixIdx matrixIdx) |
operator[] More... | |
template<typename T > | |
T & | getMatrix (const MatrixIdx matrixIdx) |
Get the matrix with a specific type from the container. More... | |
void | createMatrices () |
Create all matrix objects in the container. More... | |
void | addMatrices () |
Populate the container based on the simulation type. More... | |
void | freeMatrices () |
Destroy and free all matrices. More... | |
void | loadDataFromInputFile () |
Load all marked matrices from the input HDF5 file. More... | |
void | loadDataFromCheckpointFile () |
Load selected matrices from the checkpoint HDF5 file. More... | |
void | storeDataIntoCheckpointFile () |
Store selected matrices into the checkpoint file. More... | |
Private Attributes | |
std::map< MatrixIdx, MatrixRecord > | mContainer |
Map holding the container. | |
This container is responsible to maintain all the matrices in the code except the output streams. The matrices are allocated, freed, loaded stored and check-pointed from here.
Definition at line 49 of file MatrixContainer.h.
|
strong |
Definition at line 56 of file MatrixContainer.h.
MatrixContainer::MatrixContainer | ( | ) |
Constructor.
Definition at line 54 of file MatrixContainer.cpp.
MatrixContainer::~MatrixContainer | ( | ) |
Destructor. No need for virtual destructor (no polymorphism).
Definition at line 66 of file MatrixContainer.cpp.
void MatrixContainer::addMatrices | ( | ) |
This function creates the list of matrices being used in the simulation. It is done based on the simulation parameters. All matrices records are created here.
Definition at line 128 of file MatrixContainer.cpp.
void MatrixContainer::createMatrices | ( | ) |
std::bad_alloc | - Usually due to out of memory. |
std::invalid_argument | - If this routine is called more than once. |
std::invalid_argument | - If matrix type is unknown. |
Create all matrix objects in the container.
Definition at line 76 of file MatrixContainer.cpp.
|
inline |
Definition at line 223 of file MatrixContainer.h.
void MatrixContainer::freeMatrices | ( | ) |
Free all matrix objects.
Definition at line 419 of file MatrixContainer.cpp.
|
inline |
This template routine returns the reference to the matrix re-casted to the specific class type.
[in] | matrixIdx | - Matrix identifier, |
Definition at line 245 of file MatrixContainer.h.
void MatrixContainer::loadDataFromCheckpointFile | ( | ) |
Load selected matrices from the checkpoint HDF5 file.
Definition at line 452 of file MatrixContainer.cpp.
void MatrixContainer::loadDataFromInputFile | ( | ) |
Load all marked matrices from the input HDF5 file.
Definition at line 435 of file MatrixContainer.cpp.
|
inline |
[in] | matrixIdx | - Matrix identifier |
Definition at line 233 of file MatrixContainer.h.
|
inline |
Definition at line 214 of file MatrixContainer.h.
void MatrixContainer::storeDataIntoCheckpointFile | ( | ) |
Store selected matrices into the checkpoint file.
Definition at line 469 of file MatrixContainer.cpp.