76 if (it.second.matrixPtr !=
nullptr)
79 it.second.matrixName.c_str()));
82 switch (it.second.matrixType)
84 case TMatrixRecord::REAL:
86 it.second.matrixPtr =
new TRealMatrix(it.second.dimensionSizes);
90 case TMatrixRecord::COMPLEX:
92 it.second.matrixPtr =
new TComplexMatrix(it.second.dimensionSizes);
96 case TMatrixRecord::INDEX:
98 it.second.matrixPtr =
new TIndexMatrix(it.second.dimensionSizes);
102 case TMatrixRecord::CUFFT:
111 it.second.matrixName.c_str()));
131 const bool LOAD =
true;
132 const bool NOLOAD =
false;
133 const bool CHECKPOINT =
true;
134 const bool NOCHECKPOINT =
false;
335 const size_t nx_2 = fullDims.
nx / 2 + 1;
336 const size_t ny_2 = fullDims.
ny / 2 + 1;
337 const size_t nz_2 = fullDims.
nz / 2 + 1;
339 size_t xCutSize = nx_2 * fullDims.
ny * fullDims.
nz;
340 size_t yCutSize = fullDims.
nx * ny_2 * fullDims.
nz;
341 size_t zCutSize = fullDims.
nx * fullDims.
ny * nz_2;
343 if ((xCutSize >= yCutSize) && (xCutSize >= zCutSize))
348 else if ((yCutSize >= xCutSize) && (yCutSize >= zCutSize))
353 else if ((zCutSize >= xCutSize) && (zCutSize >= yCutSize))
410 if (it.second.loadData)
412 it.second.matrixPtr->ReadDataFromHDF5File(inputFile, it.second.matrixName);
426 if (it.second.checkpoint)
428 it.second.matrixPtr->ReadDataFromHDF5File(checkpointFile,it.second.matrixName);
442 if (it.second.checkpoint)
445 it.second.matrixPtr->CopyFromDevice();
447 it.second.matrixPtr->WriteDataToHDF5File(checkpointFile,
448 it.second.matrixName,
462 if (it.second.matrixPtr)
464 delete it.second.matrixPtr;
465 it.second.matrixPtr =
nullptr;
478 it.second.matrixPtr->CopyToDevice();
490 it.second.matrixPtr->CopyFromDevice();
TMatrixName y_shift_neg_r_NAME
y_shift_neg_r variable name
size_t nx
number of elements in the x direction
TMatrixName pml_y_sgy_NAME
pml_y_sgy variable name
TDimensionSizes GetReducedDimensionSizes() const
Reduced dimension sizes of the simulation (complex classes).
TMatrixName rhox_NAME
rhox variable name
size_t Get_sensor_mask_index_size() const
Get sensor_mask_index_size value.
void AddMatrices()
Populate the container based on the simulation type.
void FreeMatrices()
Destroy and free all matrices.
size_t Get_u_source_index_size() const
Get u_source_index_size value.
TMatrixName uy_sgy_NAME
uy_sgy variable name
TMatrixName uy_source_input_NAME
uy_source_input variable name
TMatrixName uz_shifted_NAME
uz_shifted variable name
void LoadDataFromCheckpointFile(THDF5_File &checkpointFile)
Load all matrices from the output HDF5 file.
TMatrixName temp_1_real_3D_NAME
Temp_1_RS3D variable name.
TMatrixName absorb_tau_NAME
absorb_tau variable name
TMatrixRecordContainer matrixContainer
map holding the container
TMatrixName pml_y_NAME
pml_y variable name
TMatrixName temp_3_real_3D_NAME
Temp_3_RS3D variable name.
TMatrixName p_source_index_NAME
p_source_index variable name
TMatrixName rhoy_NAME
rhoy variable name
TMatrixName ddz_k_shift_neg_NAME
ddz_k_shift_neg variable name
TMatrixName sensor_mask_index_NAME
sensor_mask_index variable name
TMatrixName transducer_source_input_NAME
transducer_source_input variable name
size_t Get_ux_source_flag() const
Get ux_source_flag value.
TMatrixName rho0_sgz_NAME
rho0_sgz variable name
TMatrixName BonA_NAME
BonA variable name.
TMatrixName ddy_k_shift_neg_NAME
ddy_k_shift_neg variable name
static TParameters & GetInstance()
Get instance of the singleton class.
TMatrixName ddy_k_shift_pos_NAME
ddy_k_shift_pos variable name
~TMatrixContainer()
Destructor.
size_t Get_sensor_mask_corners_size() const
Get number of cubes in the mask.
void LoadDataFromInputFile(THDF5_File &inputFile)
Load all matrices from the input HDF5 file.
TMatrixName duydy_NAME
duydy variable name
TMatrixName uy_shifted_NAME
uy_shifted variable name
TMatrixName absorb_eta_NAME
absorb_eta variable name
TMatrixName u_source_index_NAME
u_source_index variable name
bool Get_c0_scalar_flag() const
Get c0_scalar_flag value.
size_t Get_u_source_many() const
Get u_source_many value.
The header file containing the parameters of the simulation.
bool Get_BonA_scalar_flag() const
Get BonA_scalar_flag value.
TMatrixName uz_source_input_NAME
uz_source_input variable name
TMatrixName dxudxn_sgx_NAME
dxudxn_sgx variable name
TMatrixName p_source_input_NAME
p_source_input variable name
TMatrixName pml_z_NAME
pml_z variable name
TMatrixName sensor_mask_corners_NAME
sensor_mask_corners variable name
TMatrixName dzudzn_sgz_NAME
dzudzn_sgz variable name
bool Get_alpha_coeff_scalar_flag() const
Get alpha_coeff_scalar_flag value.
TMatrixName dxudxn_NAME
dxudxn variable name
void CreateMatrices()
Create all matrices in the container.
TDimensionSizes GetFullDimensionSizes() const
Full dimension sizes of the simulation (real classes).
The header file containing a class responsible for printing out info and error messages (stdout...
TMatrixName dyudyn_sgy_NAME
dyudyn_sgy variable name
TMatrixName ux_source_input_NAME
ux_source_input variable name
TMatrixName dyudyn_NAME
dyudyn variable name
bool IsStore_u_non_staggered_raw() const
Is –u_non_staggered_raw set?
TMatrixName c0_NAME
c0 variable name
TMatrixName rho0_sgx_NAME
rho0_sgx variable name
Class storing all parameters of the simulation.
TMatrixName cufft_Y_temp_NAME
CUFFT_Y_temp variable name.
size_t Get_uy_source_flag() const
Get uy_source_flag value.
TMatrixName ddx_k_shift_neg_r_NAME
ddx_k_shift_neg_r variable name
TMatrixName temp_2_real_3D_NAME
Temp_2_RS3D variable name.
The header file containing routines for error messages and error messages common for both linux and w...
size_t Get_p_source_many() const
Get p_source_many value.
size_t Get_p0_source_flag() const
Get p0_source_flag value.
TMatrixName duxdx_NAME
duxdx variable name
size_t ny
number of elements in the y direction
TMatrixName pml_x_NAME
pml_x variable name
TMatrixName ddx_k_shift_pos_r_NAME
ddx_k_shift_pos_r variable name
TMatrixName cufft_shift_temp_NAME
CUFFT_shift_temp variable name.
TMatrixContainer()
Constructor.
size_t Get_nonlinear_flag() const
Get nonlinear_flag value.
TErrorMessage ERR_FMT_RELOCATION_ERROR
Matrix container error message.
The class for real matrices.
size_t Get_uz_source_flag() const
Get uz_source_flag value.
TMatrixName alpha_coeff_NAME
alpha_coeff variable name
TMatrixName pml_z_sgz_NAME
pml_z_sgz variable name
The class for 64b unsigned integers (indices). It is used for sensor_mask_index or sensor_corners_mas...
TMatrixName uz_sgz_NAME
uz_sgz variable name
TMatrixName absorb_nabla1_r_NAME
absorb_nabla1_r variable name
TMatrixName delay_mask_NAME
delay_mask variable name
size_t Get_transducer_source_input_size() const
Get transducer_source_input_size value.
void CopyMatricesFromDevice()
Copy all matrices from device to host (GPU -> CPU).
size_t Get_p_source_flag() const
Get p_source_flag value.
size_t Get_transducer_source_flag() const
Get transducer_source_flag value.
TMatrixName ux_sgx_NAME
ux_sgx variable name
TMatrixName dzudzn_NAME
dzudzn variable name
TMatrixName p0_source_input_NAME
p0_source_input variable name
TMatrixName x_shift_neg_r_NAME
x_shift_neg_r variable name
size_t GetCompressionLevel() const
Get compression level.
TErrorMessage ERR_FMT_BAD_MATRIX_DISTRIBUTION_TYPE
Matrix container error message.
static std::string FormatMessage(const std::string &format, Args...args)
C++-11 replacement for sprintf that works with std::string instead of char *.
The header file containing the matrix container and the related matrix record class.
void CopyMatricesToDevice()
Copy all matrices from host to device (CPU -> GPU).
TMatrixName ux_shifted_NAME
ux_shifted variable name
TMatrixName absorb_nabla2_r_NAME
absorb_nabla2_r variable name
TMatrixName cufft_z_temp_NAME
CUFFT_Z_temp variable name.
size_t Get_p_source_index_size() const
Get p_source_index_size value.
TMatrixName rhoz_NAME
rhoz variable name
bool Get_rho0_scalar_flag() const
Get rho0_scalar_flag value.
size_t Get_absorbing_flag() const
Get absorbing_flag value.
void StoreDataIntoCheckpointFile(THDF5_File &checkpointFile)
Store selected matrices into the checkpoint file.
TMatrixName z_shift_neg_r_NAME
z_shift_neg_r variable name
size_t Get_nonuniform_grid_flag() const
Get nonuniform_grid_flag value.
size_t nz
number of elements in the z direction
TMatrixName kappa_r_NAME
kappa_r variable name
The class for complex matrices.
TMatrixName pml_x_sgx_NAME
pml_x_sgx variable name
TMatrixName rho0_sgy_NAME
rho0_sgy variable name
TMatrixName cufft_X_temp_NAME
CUFFT_X_temp variable name.
Class implementing 3D Real-To-Complex and Complex-To-Real transforms using CUDA FFT interface...
TSensorMaskType Get_sensor_mask_type() const
Get sensor mask type (linear or corners).
TMatrixName ddz_k_shift_pos_NAME
ddz_k_shift_pos variable name
TMatrixName rho0_NAME
rho0 variable name
Class wrapping the HDF5 routines.
TMatrixName p_NAME
p variable name
Structure with 4D dimension sizes (3 in space and 1 in time).
TMatrixName duzdz_NAME
duzdz variable name