82 if (it.second.matrixPtr !=
nullptr)
87 switch (it.second.matrixType)
89 case MatrixType::kReal:
91 it.second.matrixPtr =
new RealMatrix(it.second.dimensionSizes);
95 case MatrixType::kComplex:
97 it.second.matrixPtr =
new ComplexMatrix(it.second.dimensionSizes);
101 case MatrixType::kIndex:
103 it.second.matrixPtr =
new IndexMatrix(it.second.dimensionSizes);
107 case MatrixType::kFftw:
138 constexpr
bool kLoad =
true;
139 constexpr
bool kNoLoad =
false;
140 constexpr
bool kCheckpoint =
true;
141 constexpr
bool kNoCheckpoint =
false;
152 mContainer[MI::kP] .set(MT::kReal, fullDims , kNoLoad, kCheckpoint,
kPName);
220 mContainer[MI::kSensorMaskIndex].set(MT::kIndex,
228 mContainer[MI::kSensorMaskCorners].set(MT::kIndex,
237 mContainer[MI::kInitialPressureSourceInput].set(MT::kReal,fullDims, kLoad, kNoCheckpoint,
248 mContainer[MI::kVelocitySourceIndex].set(MT::kIndex,
267 mContainer[MI::kPressureSourceInput].set(MT::kReal,
273 mContainer[MI::kPressureSourceInput].set(MT::kReal,
279 mContainer[MI::kPressureSourceIndex].set(MT::kIndex,
291 mContainer[MI::kVelocityXSourceInput].set(MT::kReal,
297 mContainer[MI::kVelocityXSourceInput].set(MT::kReal,
309 mContainer[MI::kVelocityYSourceInput].set(MT::kReal,
315 mContainer[MI::kVelocityYSourceInput].set(MT::kReal,
326 mContainer[MI::kVelocityZSourceInput].set(MT::kReal,
332 mContainer[MI::kVelocityZSourceInput].set(MT::kReal,
357 size_t nxR = fullDims.
nx / 2 + 1;
358 size_t nyR = fullDims.
ny / 2 + 1;
359 size_t nzR = fullDims.
nz / 2 + 1;
361 size_t xCutSize = nxR * fullDims.
ny * fullDims.
nz;
362 size_t yCutSize = fullDims.
nx * nyR * fullDims.
nz;
363 size_t zCutSize = fullDims.
nx * fullDims.
ny * nzR;
365 if ((xCutSize >= yCutSize) && (xCutSize >= zCutSize))
369 else if ((yCutSize >= xCutSize) && (yCutSize >= zCutSize))
373 else if ((zCutSize >= xCutSize) && (zCutSize >= yCutSize))
423 if (it.second.matrixPtr)
425 delete it.second.matrixPtr;
426 it.second.matrixPtr =
nullptr;
441 if (it.second.loadData)
443 it.second.matrixPtr->readData(inputFile, it.second.matrixName);
458 if (it.second.checkpoint)
460 it.second.matrixPtr->readData(checkpointFile,it.second.matrixName);
476 if (it.second.checkpoint)
478 it.second.matrixPtr->writeData(checkpointFile, it.second.matrixName, compressionLevel);
MatrixName kYShiftNegRName
y_shift_neg_r variable name
The class for real matrices.
MatrixName kRhoYName
rhoy variable name
Hdf5File & getCheckpointFile()
Get checkpoint file handle.
MatrixName kDxudxnSgxName
dxudxn_sgx variable name
size_t getCompressionLevel() const
Get compression level.
MatrixName kUzShiftedName
uz_shifted variable name
Class implementing 3D and 1D Real-To-Complex and Complex-To-Real transforms using FFTW interface...
size_t nz
Number of elements in the z direction.
bool getC0ScalarFlag() const
Is sound speed in the medium homogeneous (scalar value)?
MatrixName kTemp3Real3DName
Temp_3_RS3D variable name.
MatrixName kPmlYSgyName
pml_y_sgy variable name
bool getRho0ScalarFlag() const
Is density in the medium homogeneous (scalar value)?
size_t getPressureSourceIndexSize() const
Get spatial size of the pressure source.
size_t getTransducerSourceFlag() const
Get transducer source flag.
ErrorMessage kErrFmtBadMatrixType
Matrix container error message.
size_t getSensorMaskIndexSize() const
Get spatial size of the index sensor mask.
MatrixName kDdxKShiftPosRName
ddx_k_shift_pos_r variable name
size_t getNonLinearFlag() const
Is the wave propagation nonlinear?
MatrixName kVelocityYSourceInputName
uy_source_input variable name
The header file containing the class for real matrices.
MatrixName kRho0Name
rho0 variable name
void loadDataFromCheckpointFile()
Load selected matrices from the checkpoint HDF5 file.
MatrixName kDelayMaskName
delay_mask variable name
MatrixName kAbsorbNabla1RName
absorb_nabla1_r variable name
MatrixName kUySgyName
uy_sgy variable name
Class storing all parameters of the simulation.
MatrixName kPmlZName
pml_z variable name
MatrixName kVelocityXSourceInputName
ux_source_input variable name
DimensionSizes getFullDimensionSizes() const
Get full dimension sizes of the simulation (real classes).
MatrixName kDuydyName
duydy variable name
MatrixName kAbsorbNabla2RName
absorb_nabla2_r variable name
MatrixName kDdzKShiftNegName
ddz_k_shift_neg variable name
MatrixName kDuxdxName
duxdx variable name
MatrixName kCufftShiftTempName
CUFFT_shift_temp variable name.
The header file containing the parameters of the simulation.
size_t getPressureSourceFlag() const
Get pressure source flag.
MatrixName kPmlZSgzName
pml_z_sgz variable name
size_t getNonUniformGridFlag() const
Enable non uniform grid? - not implemented yet.
void freeMatrices()
Destroy and free all matrices.
MatrixName kUxSgxName
ux_sgx variable name
MatrixName kCufftYTempName
CUFFT_Y_temp variable name.
bool getStoreVelocityNonStaggeredRawFlag() const
Is –u_non_staggered_raw set?
std::map< MatrixIdx, MatrixRecord > mContainer
Map holding the container.
MatrixName kC0Name
c0 variable name
MatrixName kDxudxnName
dxudxn variable name
MatrixName kBonAName
BonA variable name.
void createMatrices()
Create all matrix objects in the container.
The header file containing a class responsible for printing out info and error messages (stdout...
~MatrixContainer()
Destructor.
size_t getVelocityXSourceFlag() const
Get velocity in x source flag.
Class wrapping the HDF5 routines.
MatrixName kPmlXSgxName
pml_x_sgx variable name
The class for complex matrices.
MatrixName kDyudynName
dyudyn variable name
MatrixName kXShiftNegRName
x_shift_neg_r variable name
MatrixName kKappaRName
kappa_r variable name
MatrixName kDdyKShiftPosName
ddy_k_shift_pos variable name
MatrixName kVelocityZSourceInputName
uz_source_input variable name
MatrixName kInitialPressureSourceInputName
p0_source_input variable name
MatrixName kPmlYName
pml_y variable name
MatrixType
All possible types of the matrix.
static std::string formatMessage(const std::string &format, Args ... args)
C++-11 replacement for sprintf that works with std::string instead of char*.
bool getBOnAScalarFlag() const
Is nonlinear coefficient homogeneous in the medium (scalar value)?
The header file containing the class for 64b integer matrices.
MatrixName kPName
p variable name
MatrixContainer()
Constructor.
MatrixName kTemp2Real3DName
Temp_2_RS3D variable name.
MatrixName kDzudznName
dzudzn variable name
MatrixIdx
Matrix identifers of all matrices in the k-space code.
Structure with 4D dimension sizes (3 in space and 1 in time).
MatrixName kDdxKShiftNegRName
ddx_k_shift_neg_r variable name
size_t getInitialPressureSourceFlag() const
Get initial pressure source flag (p0).
MatrixName kVelocitySourceIndexName
u_source_index variable name
Cuboid corners sensor mask.
ErrorMessage kErrFmtRelocationError
Matrix container error message.
MatrixName kDyudynSgyName
dyudyn_sgy variable name
SensorMaskType getSensorMaskType() const
Get sensor mask type (linear or corners).
size_t getTransducerSourceInputSize() const
Get spatial size of the transducer source.
MatrixName kUzSgzName
uz_sgz variable name
The header file with the class for complex matrices.
size_t ny
Number of elements in the y direction.
MatrixName kAlphaCoeffName
alpha_coeff variable name
MatrixName kSensorMaskIndexName
sensor_mask_index variable name
MatrixName kDdzKShiftPosName
ddz_k_shift_pos variable name
size_t getVelocitySourceIndexSize() const
Get spatial size of the velocity source.
Hdf5File & getInputFile()
Get input file handle.
bool getAlphaCoeffScalarFlag() const
Is alpha absorption coefficient homogeneous (scalar value)?
MatrixName kAbsorbEtaName
absorb_eta variable name
MatrixName kRho0SgyName
rho0_sgy variable name
void storeDataIntoCheckpointFile()
Store selected matrices into the checkpoint file.
MatrixName kTransducerSourceInputName
transducer_source_input variable name
The header file containing the matrix container.
size_t getVelocityYSourceFlag() const
Get velocity in y source flag.
MatrixName kCufftZTempName
CUFFT_Z_temp variable name.
MatrixName kRho0SgzName
rho0_sgz variable name
MatrixName kDdyKShiftNegName
ddy_k_shift_neg variable name
MatrixName kDuzdzName
duzdz variable name
MatrixName kUxShiftedName
ux_shifted variable name
MatrixName kSensorMaskCornersName
sensor_mask_corners variable name
size_t nx
Number of elements in the x direction.
void loadDataFromInputFile()
Load all marked matrices from the input HDF5 file.
size_t getPressureSourceMany() const
Get number of time series in the pressure source.
size_t getVelocityZSourceFlag() const
Get velocity in z source flag.
The header file containing the class that implements 3D FFT using the FFTW interface.
MatrixName kPressureSourceIndexName
p_source_index variable name
MatrixName kDzudznSgzName
dzudzn_sgz variable name
size_t getVelocitySourceMany() const
Get number of time series in the velocity sources.
static Parameters & getInstance()
Get instance of the singleton class.
MatrixName kZShiftNegRName
z_shift_neg_r variable name
size_t getAbsorbingFlag() const
Is the simulation absrobing or lossless?
MatrixName kRhoZName
rhoz variable name
MatrixName kRho0SgxName
rho0_sgx variable name
The class for 64b unsigned integers (indices). It is used for linear and cuboid corners masks to get ...
MatrixName kPressureSourceInputName
p_source_input variable name
MatrixName kAbsorbTauName
absorb_tau variable name
MatrixName kUyShiftedName
uy_shifted variable name
MatrixName kRhoXName
rhox variable name
size_t getSensorMaskCornersSize() const
Get number of cuboids the sensor is composed of.
MatrixName kCufftXTempName
CUFFT_X_temp variable name.
void addMatrices()
Populate the container based on the simulation type.
MatrixName kPmlXName
pml_x variable name
MatrixName kTemp1Real3DName
Temp_1_RS3D variable name.
DimensionSizes getReducedDimensionSizes() const
Get reduced dimension sizes of the simulation (complex classes).