61 MatrixPtr(src.MatrixPtr),
62 MatrixDataType(src.MatrixDataType),
63 DimensionSizes(src.DimensionSizes),
64 LoadData(src.LoadData),
65 Checkpoint(src.Checkpoint),
66 HDF5MatrixName(src.HDF5MatrixName)
109 const bool Checkpoint,
110 const string HDF5MatrixName)
159 if (it->second.MatrixPtr != NULL)
162 it->second.HDF5MatrixName,
166 switch (it->second.MatrixDataType)
168 case TMatrixRecord::mdtReal:
170 it->second.MatrixPtr =
new TRealMatrix(it->second.DimensionSizes);
174 case TMatrixRecord::mdtComplex:
176 it->second.MatrixPtr =
new TComplexMatrix(it->second.DimensionSizes);
180 case TMatrixRecord::mdtIndex:
182 it->second.MatrixPtr =
new TIndexMatrix(it->second.DimensionSizes);
186 case TMatrixRecord::mdtFFTW:
192 case TMatrixRecord::mdtUxyz:
201 it->second.HDF5MatrixName,
219 if (it->second.LoadData)
221 it->second.MatrixPtr->ReadDataFromHDF5File(HDF5_File, it->second.HDF5MatrixName.c_str());
236 if (it->second.Checkpoint)
238 it->second.MatrixPtr->ReadDataFromHDF5File(HDF5_File, it->second.HDF5MatrixName.c_str());
252 if (it->second.Checkpoint)
254 it->second.MatrixPtr->WriteDataToHDF5File(HDF5_File,
255 it->second.HDF5MatrixName.c_str(),
271 if (it->second.MatrixPtr)
273 delete it->second.MatrixPtr;
274 it->second.MatrixPtr = NULL;
295 const bool LOAD =
true;
296 const bool NOLOAD =
false;
297 const bool CHECKPOINT =
true;
298 const bool NOCHECKPOINT =
false;
308 MatrixContainer[p] .SetAllValues(NULL ,TMatrixRecord::mdtReal, FullDims , NOLOAD, CHECKPOINT,
p_Name);
370 MatrixContainer[sensor_mask_index].SetAllValues(NULL,TMatrixRecord::mdtIndex,
378 MatrixContainer[sensor_mask_corners].SetAllValues(NULL,TMatrixRecord::mdtIndex,
397 MatrixContainer[u_source_index].SetAllValues(NULL,TMatrixRecord::mdtIndex,
416 MatrixContainer[p_source_input].SetAllValues(NULL,TMatrixRecord::mdtReal,
422 MatrixContainer[p_source_input].SetAllValues(NULL,TMatrixRecord::mdtReal,
427 MatrixContainer[p_source_index].SetAllValues(NULL,TMatrixRecord::mdtIndex,
439 MatrixContainer[ux_source_input].SetAllValues(NULL,TMatrixRecord::mdtReal,
445 MatrixContainer[ux_source_input].SetAllValues(NULL,TMatrixRecord::mdtReal,
456 MatrixContainer[uy_source_input].SetAllValues(NULL,TMatrixRecord::mdtReal,
462 MatrixContainer[uy_source_input].SetAllValues(NULL,TMatrixRecord::mdtReal,
472 MatrixContainer[uz_source_input].SetAllValues(NULL,TMatrixRecord::mdtReal,
478 MatrixContainer[uz_source_input].SetAllValues(NULL,TMatrixRecord::mdtReal,
502 size_t X_2 = FullDims.
X / 2 + 1;
503 size_t Y_2 = FullDims.
Y / 2 + 1;
504 size_t Z_2 = FullDims.
Z / 2 + 1;
506 size_t XCutSize = X_2 * FullDims.
Y * FullDims.
Z;
507 size_t YCutSize = FullDims.
X * Y_2 * FullDims.
Z;
508 size_t ZCutSize = FullDims.
X * FullDims.
Y * Z_2;
510 if ((XCutSize >= YCutSize) && (XCutSize >= ZCutSize))
514 else if ((YCutSize >= XCutSize) && (YCutSize >= ZCutSize))
518 else if ((ZCutSize >= XCutSize) && (ZCutSize >= YCutSize))
527 MatrixContainer[FFT_shift_temp].SetAllValues(NULL, TMatrixRecord::mdtFFTW, ShiftDims, NOLOAD, NOCHECKPOINT,
"");
530 MatrixContainer[ux_shifted].SetAllValues(NULL, TMatrixRecord::mdtReal, FullDims, NOLOAD, NOCHECKPOINT,
"");
531 MatrixContainer[uy_shifted].SetAllValues(NULL, TMatrixRecord::mdtReal, FullDims, NOLOAD, NOCHECKPOINT,
"");
532 MatrixContainer[uz_shifted].SetAllValues(NULL, TMatrixRecord::mdtReal, FullDims, NOLOAD, NOCHECKPOINT,
"");
552 MatrixContainer[Temp_1_RS3D].SetAllValues(NULL,TMatrixRecord::mdtReal, FullDims , NOLOAD, NOCHECKPOINT,
"");
555 MatrixContainer[Temp_2_RS3D].SetAllValues(NULL,TMatrixRecord::mdtReal, FullDims , NOLOAD, NOCHECKPOINT,
"");
556 MatrixContainer[Temp_3_RS3D].SetAllValues(NULL,TMatrixRecord::mdtReal, FullDims , NOLOAD, NOCHECKPOINT,
"");
558 MatrixContainer[FFT_X_temp].SetAllValues(NULL, TMatrixRecord::mdtFFTW, ReducedDims, NOLOAD, NOCHECKPOINT,
"");
559 MatrixContainer[FFT_Y_temp].SetAllValues(NULL, TMatrixRecord::mdtFFTW, ReducedDims, NOLOAD, NOCHECKPOINT,
"");
560 MatrixContainer[FFT_Z_temp].SetAllValues(NULL, TMatrixRecord::mdtFFTW, ReducedDims, NOLOAD, NOCHECKPOINT,
"");
586 const string HDF5MatrixName,
590 fprintf(stderr,FMT, HDF5MatrixName.c_str(), File, Line);
637 TBaseOutputHDF5Stream::roNONE,
646 TBaseOutputHDF5Stream::roRMS);
654 TBaseOutputHDF5Stream::roMAX);
662 TBaseOutputHDF5Stream::roMIN);
671 TBaseOutputHDF5Stream::roMAX);
680 TBaseOutputHDF5Stream::roMIN);
689 TBaseOutputHDF5Stream::roNONE,
694 TBaseOutputHDF5Stream::roNONE,
699 TBaseOutputHDF5Stream::roNONE,
708 TBaseOutputHDF5Stream::roNONE,
713 TBaseOutputHDF5Stream::roNONE,
718 TBaseOutputHDF5Stream::roNONE,
727 TBaseOutputHDF5Stream::roRMS);
731 TBaseOutputHDF5Stream::roRMS);
735 TBaseOutputHDF5Stream::roRMS);
743 TBaseOutputHDF5Stream::roMAX);
747 TBaseOutputHDF5Stream::roMAX);
751 TBaseOutputHDF5Stream::roMAX);
759 TBaseOutputHDF5Stream::roMIN);
763 TBaseOutputHDF5Stream::roMIN);
767 TBaseOutputHDF5Stream::roMIN);
776 TBaseOutputHDF5Stream::roMAX);
781 TBaseOutputHDF5Stream::roMAX);
786 TBaseOutputHDF5Stream::roMAX);
795 TBaseOutputHDF5Stream::roMIN);
800 TBaseOutputHDF5Stream::roMIN);
805 TBaseOutputHDF5Stream::roMIN);
819 (it->second)->Create();
834 (it->second)->Reopen();
850 (it->second)->Sample();
866 (it->second)->Checkpoint();
881 (it->second)->PostProcess();
897 (it->second)->Close();
936 const char * HDF5_DatasetName,
938 float * BufferToReuse)
const char *const transducer_source_input_Name
transducer_source_input variable name
size_t Z
Z dimension size.
TDimensionSizes GetReducedDimensionSizes() const
Reduced dimension sizes of the simulation (complex classes).
const char *const pml_x_Name
pml_x variable name
bool LoadData
Is the matrix content loaded from the HDF5 file.
size_t Get_sensor_mask_index_size() const
Get sensor_mask_index_size value.
void AddStreamsIntoContainer(TMatrixContainer &MatrixContainer)
Create all streams in container (no file manipulation).
size_t Get_u_source_index_size() const
Get u_source_index_size value.
void StoreDataIntoCheckpointHDF5File(THDF5_File &HDF5_File)
Store selected matrices into the checkpoint file.
TReductionOperator
How to aggregate data.
const char *const ux_rms_Name
ux_rms variable name
const char *const ux_max_Name
ux_max variable name
const char *const x_shift_neg_r_Name
x_shift_neg_r variable name
const char *const p_rms_Name
p_rms variable name
THDF5_File HDF5_OutputFile
Handle to the output HDF5 file.
const char *const duxdx_Name
duxdx variable name
Abstract base class, the common ancestor defining the common interface and allowing derived classes t...
TMatrixRecordContainer MatrixContainer
Map holding the container.
Output stream for quantities sampled in the whole domain.
const char *const pml_z_Name
pml_z variable name
const char *const p_max_all_Name
p_max_all variable name
const char *const uy_Name
uy variable name
Output stream for quantities sampled by a cuboid corner sensor mask.
const char *const uy_min_Name
uy_min variable name
const char *const delay_mask_Name
delay_mask variable name
const char *const uy_max_all_Name
uy_max_all variable name
const char *const ddx_k_shift_neg_r_Name
ddx_k_shift_neg_r variable name
size_t Get_ux_source_flag() const
Get ux_source_flag value.
const char *const pml_y_Name
pml_y variable name
bool IsStore_u_min() const
Is –u_min specified at the command line?
TSenosrMaskType Get_sensor_mask_type() const
Get sensor mask type (linear or corners).
void FreeAllStreams()
Free all streams - destroy them.
bool IsStore_u_raw() const
Is -u or –u_raw specified at the command line?
virtual ~TMatrixContainer()
Destructor.
size_t Get_sensor_mask_corners_size() const
Get number of cubes in the mask.
const char *const z_shift_neg_r_Name
z_shift_neg_r variable name
const char *const rho0_Name
rho0 variable name
const char *const BonA_Name
BonA variable name.
const char *const ddz_k_shift_pos_Name
ddz_k_shift_pos variable name
const char *const p_source_input_Name
p_source_input variable name
const char *const absorb_nabla2_r_Name
absorb_nabla2_r variable name
const char *const uz_max_all_Name
uz_max_all variable name
bool Checkpoint
Is the matrix necessary to be preserver when checkpoint is enabled.
bool Get_c0_scalar_flag() const
Get c0_scalar_flag value.
const char *const ddx_k_shift_pos_r_Name
ddx_k_shift_pos_r variable name
const char *const uz_non_staggered_Name
uz_non_staggered variable name
const char *const y_shift_neg_r_Name
y_shift_neg_r variable name
size_t X
X dimension size.
size_t Get_u_source_many() const
Get u_source_many value.
const char *const p_min_Name
p_min variable name
The header file containing the parameters of the simulation.
bool Get_BonA_scalar_flag() const
Get BonA_scalar_flag value.
const char *const alpha_coeff_Name
alpha_coeff variable name
const char *const rhox_Name
rhox variable name
const char *const ddy_k_shift_pos_Name
ddy_k_shift_pos variable name
const char *const absorb_tau_Name
absorb_tau variable name
const char *const duydy_Name
duydy variable name
const char *const ddy_k_shift_neg_Name
ddy_k_shift_neg variable name
const char *const uy_source_input_Name
uy_source_input variable name
const char *const absorb_eta_Name
absorb_eta variable name
Class implementing 3D Real-To-Complex and Complex-To-Real transforms using FFTW interface.
const char *const c0_Name
c0 variable name
const char *const uy_rms_Name
uy_rms variable name
TMatrixDataType MatrixDataType
Matrix data type.
const char *const dzudzn_sgz_Name
dzudzn_sgz variable name
const char *const p_max_Name
p_max variable name
const char *const rho0_sgy_Name
rho0_sgy variable name
bool IsStore_u_rms() const
Is –u_raw specified at the command line?
void FreeAllMatrices()
Free all matrices - destroy them.
TDimensionSizes GetFullDimensionSizes() const
Full dimension sizes of the simulation (real classes).
bool IsStore_p_raw() const
Is -p or –p_raw specified at the command line?
bool IsStore_p_rms() const
Is –p_rms specified at the command line?
bool IsStore_p_min_all() const
Is –p_min_all specified at the command line?
TMatrixRecord & operator=(const TMatrixRecord &src)
operator =
bool IsStore_p_min() const
Is –p_min specified at the command line?
Output stream for quantities sampled by an index sensor mask.
The header file of classes responsible for storing output quantities into the output HDF5 file...
const char *const pml_y_sgy_Name
pml_y_sgy variable name
bool IsStore_u_non_staggered_raw() const
Is –u_non_staggered_raw set?
bool IsStore_u_min_all() const
Is –u_min_all specified at the command line?
Class storing all parameters of the simulation.
size_t Get_uy_source_flag() const
Get uy_source_flag value.
const char *const uz_max_Name
uz_max variable name
TBaseOutputHDF5Stream * CreateNewOutputStream(TMatrixContainer &MatrixContainer, const TMatrixID SampledMatrixID, const char *HDF5_DatasetName, const TBaseOutputHDF5Stream::TReductionOperator ReductionOp, float *BufferToReuse=NULL)
const char *const dxudxn_Name
dxudxn variable name
TMatrixID
Matrix identifers of all matrices in the k-space code.
void SampleStreams()
Sample all streams.
void LoadDataFromInputHDF5File(THDF5_File &HDF5_File)
Load all matrices from the HDF5 file.
const char *const p_min_all_Name
p_min_all variable name
string HDF5MatrixName
HDF5 matrix name.
The header file containing all error messages of the project.
size_t Get_p_source_many() const
Get p_source_many value.
size_t Get_p0_source_flag() const
Get p0_source_flag value.
void ReopenStreams()
Reopen streams after checkpoint file (datasets).
const char *const dzudzn_Name
dzudzn variable name
const char *const ux_source_input_Name
ux_source_input variable name
Abstract base class for output data streams (sampled data).
Class implementing the matrix container.
const char *const uy_max_Name
uy_max variable name
TBaseMatrix * MatrixPtr
Pointer to the matrix object.
size_t Get_nonlinear_flag() const
Get nonlinear_flag value.
TDimensionSizes DimensionSizes
Matrix dimension sizes.
The class for real matrices.
size_t Y
Y dimension size.
const char *const uy_non_staggered_Name
uy_non_staggered variable name
A structure storing details about the matrix. The matrix container stores this structures.
const char *const uz_source_input_Name
uz_source_input variable name
const char *const rhoz_Name
rhoz variable name
TOutputStreamMap OutputStreamContainer
Map with output streams.
size_t Get_uz_source_flag() const
Get uz_source_flag value.
bool IsStore_p_max_all() const
Is –p_max_all specified at the command line?
const char *const ux_min_all_Name
ux_min_all variable name
const char *const uz_rms_Name
uz_rms variable name
const char *const MatrixContainer_ERR_FMT_ReloactaionError
Matrix container error message.
const char *const uy_sgy_Name
uy_sgy variable name
void SetAllValues(TBaseMatrix *MatrixPtr, const TMatrixDataType MatrixDataType, const TDimensionSizes DimensionSizes, const bool LoadData, const bool Checkpoint, const string HDF5MatrixName)
Set all values of the record.
const char *const sensor_mask_corners_Name
sensor_mask_corners variable name
void CheckpointStreams()
Checkpoint streams.
The class for 64b unsigned integers (indices). It is used for sensor_mask_index or sensor_corners_mas...
const char *const absorb_nabla1_r_Name
absorb_nabla1_r variable name
const char *const uz_sgz_Name
uz_sgz variable name
size_t Get_transducer_source_input_size() const
Get transducer_source_input_size value.
const char *const kappa_r_Name
kappa_r variable name
const char *const uz_min_Name
uz_min variable name
size_t Get_p_source_flag() const
Get p_source_flag value.
TMatrixDataType
All possible types of the matrix.
size_t Get_transducer_source_flag() const
Get transducer_source_flag value.
virtual ~TOutputStreamContainer()
Destructor.
const char *const ux_min_Name
ux_min variable name
const char *const dyudyn_Name
dyudyn variable name
size_t GetCompressionLevel() const
Get compression level.
const char *const MatrixContainer_ERR_FMT_RecordUnknownDistributionType
Matrix container error message.
bool Get_alpha_coeff_scallar_flag() const
Get alpha_coeff_scallar_flag value.
const char *const dxudxn_sgx_Name
dxudxn_sgx variable name
The header file containing the matrix container.
const char *const duzdz_Name
duzdz variable name
const char *const pml_z_sgz_Name
pml_z_sgz variable name
bool IsStore_u_max() const
Is –u_max specified at the command line?
const char *const u_source_index_Name
u_source_index variable name
bool IsStore_u_max_all() const
Is –u_max_all specified at the command line.
const char *const rho0_sgz_Name
rho0_sgz variable name
const char *const ux_max_all_Name
ux_max_all variable name
const char *const dyudyn_sgy_Name
dyudyn_sgy variable name
bool IsStore_p_max() const
Is –p_max specified at the command line?
size_t Get_p_source_index_size() const
Get p_source_index_size value.
const char *const uz_min_all_Name
uz_min_all variable name
void CreateStreams()
Create all streams - opens the datasets.
const char *const pml_x_sgx_Name
pml_x_sgx variable name
T & GetMatrix(const TMatrixID MatrixID)
Get the matrix with a specific type from the container.
bool Get_rho0_scalar_flag() const
Get rho0_scalar_flag value.
const char *const p0_source_input_Name
p0_source_input variable name
size_t Get_absorbing_flag() const
Get absorbing_flag value.
void AddMatricesIntoContainer()
Set all matrices recored - populate the container.
void LoadDataFromCheckpointHDF5File(THDF5_File &HDF5_File)
Load all matrices from the HDF5 file.
const char *const rho0_sgx_Name
rho0_sgx variable name
const char *const uz_Name
uz variable name
size_t Get_nonuniform_grid_flag() const
Get nonuniform_grid_flag value.
const char *const p_source_index_Name
p_source_index variable name
The class for complex matrices.
const char *const rhoy_Name
rhoy variable name
const char *const sensor_mask_index_Name
sensor_mask_index variable name
const char *const ux_sgx_Name
ux_sgx variable name
const char *const uy_min_all_Name
uy_min_all variable name
void PrintErrorAndThrowException(const char *FMT, const string HDF5MatrixName, const char *File, const int Line)
Print error and throw an exception.
void CloseStreams()
Close all streams.
TMatrixRecord()
Default constructor.
const char *const ddz_k_shift_neg_Name
ddz_k_shift_neg variable name
const char *const ux_non_staggered_Name
ux_non_staggered variable name
void CreateAllObjects()
Create instances of all objects in the container.
Class wrapping the HDF5 routines.
Structure with 4D dimension sizes (3 in space and 1 in time).
const char *const ux_Name
ux variable name
void PostProcessStreams()
Post-process all streams and flush them to the file.
static TParameters * GetInstance()
Get instance of the singleton class.
const char *const p_Name
p variable name