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
TMatrixContainer Class Reference

Class implementing the matrix container. More...

#include <MatrixContainer.h>

Collaboration diagram for TMatrixContainer:

Public Member Functions

 TMatrixContainer ()
 Constructor. More...
 
 ~TMatrixContainer ()
 Destructor. More...
 
size_t Size () const
 Get the number of matrices in the container. More...
 
bool IsEmpty () const
 Is the container empty? More...
 
TMatrixRecordoperator[] (const TMatrixIdx matrixIdx)
 operator[] More...
 
template<typename T >
T & GetMatrix (const TMatrixIdx matrixIdx)
 Get the matrix with a specific type from the container. More...
 
void CreateMatrices ()
 Create all matrices in the container.
 
void AddMatrices ()
 Populate the container based on the simulation type. More...
 
void FreeMatrices ()
 Destroy and free all matrices. More...
 
void LoadDataFromInputFile (THDF5_File &inputFile)
 Load all matrices from the input HDF5 file. More...
 
void LoadDataFromCheckpointFile (THDF5_File &checkpointFile)
 Load all matrices from the output HDF5 file. More...
 
void StoreDataIntoCheckpointFile (THDF5_File &checkpointFile)
 Store selected matrices into the checkpoint file. More...
 
void CopyMatricesToDevice ()
 Copy all matrices from host to device (CPU -> GPU). More...
 
void CopyMatricesFromDevice ()
 Copy all matrices from device to host (GPU -> CPU). More...
 

Private Types

typedef std::map< TMatrixIdx,
TMatrixRecord
TMatrixRecordContainer
 Datatype for the map associating the matrix ID enum and matrix record.
 

Private Member Functions

 TMatrixContainer (const TMatrixContainer &orig)
 Copy constructor is not allowed for public.
 
TMatrixContaineroperator= (const TMatrixContainer &src)
 Operator = is not allowed for public.
 

Private Attributes

TMatrixRecordContainer matrixContainer
 map holding the container
 

Detailed Description

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 96 of file MatrixContainer.h.

Constructor & Destructor Documentation

TMatrixContainer::TMatrixContainer ( )

Constructor

Definition at line 51 of file MatrixContainer.cpp.

TMatrixContainer::~TMatrixContainer ( )

Destructor. No need for virtual destructor (no polymorphism).

Definition at line 62 of file MatrixContainer.cpp.

Member Function Documentation

void TMatrixContainer::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 123 of file MatrixContainer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void TMatrixContainer::CopyMatricesFromDevice ( )

Copy all matrices back over to CPU. Can be used for debugging purposes.

Definition at line 486 of file MatrixContainer.cpp.

void TMatrixContainer::CopyMatricesToDevice ( )

Copy all matrices over to the GPU.

Definition at line 474 of file MatrixContainer.cpp.

Here is the caller graph for this function:

void TMatrixContainer::FreeMatrices ( )

Free all matrix objects.

Definition at line 458 of file MatrixContainer.cpp.

Here is the caller graph for this function:

template<typename T >
T& TMatrixContainer::GetMatrix ( const TMatrixIdx  matrixIdx)
inline

This template routine returns the reference to the matrix re-casted to the specific class type.

Parameters
[in]matrixIdx- Matrix identifier
Returns
Reference to the Matrix

Definition at line 144 of file MatrixContainer.h.

bool TMatrixContainer::IsEmpty ( ) const
inline

Is the container empty?

Returns
true if the container is empty.

Definition at line 120 of file MatrixContainer.h.

void TMatrixContainer::LoadDataFromCheckpointFile ( THDF5_File checkpointFile)

Load selected matrices from the checkpoint HDF5 file.

Parameters
[in]checkpointFile- HDF5 checkpoint file handle

Definition at line 422 of file MatrixContainer.cpp.

Here is the caller graph for this function:

void TMatrixContainer::LoadDataFromInputFile ( THDF5_File inputFile)

Load all marked matrices from the input HDF5 file.

Parameters
[in]inputFile- HDF5 input file handle

Definition at line 406 of file MatrixContainer.cpp.

Here is the caller graph for this function:

TMatrixRecord& TMatrixContainer::operator[] ( const TMatrixIdx  matrixIdx)
inline

operator[]

Parameters
[in]matrixIdx- Matrix identifier
Returns
Matrix record

Definition at line 131 of file MatrixContainer.h.

size_t TMatrixContainer::Size ( ) const
inline

Get the number of matrices in the container.

Returns
The number of matrices in the container.

Definition at line 110 of file MatrixContainer.h.

void TMatrixContainer::StoreDataIntoCheckpointFile ( THDF5_File checkpointFile)

Store selected matrices into the checkpoint file.

Parameters
[in]checkpointFile- Checkpoint file

Definition at line 438 of file MatrixContainer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files: