32 #ifndef KSPACE_FIRST_ORDER_3D_SOLVER_H 33 #define KSPACE_FIRST_ORDER_3D_SOLVER_H 333 template<
bool bOnAScalarFlag,
bool rho0ScalarFlag>
364 template<
bool c0ScalarFlag,
bool areTauAndEtaScalars>
377 template<
bool c0ScalarFlag,
bool areTauAndEtaScalars>
388 template<
bool c0ScalarFlag,
bool nonlinearFlag,
bool rho0ScalarFlag>
ComplexMatrix & getDdyKShiftNeg()
Get negative Fourier shift in y.
IndexMatrix & getDelayMask()
Get delay mask for many types sources.
RealMatrix & getVelocityZSourceInput()
Get Velocity source input data in z direction.
ComplexMatrix & getDdyKShiftPos()
Get positive Fourier shift in y.
The class for real matrices.
void generateKappa()
Generate kappa matrix for lossless media.
bool isCheckpointInterruption() const
Was the loop interrupted to checkpoint?
RealMatrix & getDuydy()
Get velocity gradient on in y direction.
void sumPressureTermsLinear(const RealMatrix &absorbTauTerm, const RealMatrix &absorbEtaTerm, const RealMatrix &densitySum)
Sum sub-terms to calculate new pressure, after FFTs, linear case.
RealMatrix & getRhoX()
Get density matrix in x direction.
void computePressureTermsLinear(RealMatrix &densitySum, RealMatrix &velocityGradientSum)
Calculate two temporary sums in the new pressure formula before taking the FFT, linear absorbing case...
Initial pressure source data.
RealMatrix & getAbsorbNabla2()
Get absorbing coefficient Nabla2.
velocity shift for non-staggered velocity in x.
void addTransducerSource()
Add transducer data source to velocity x component.
double getDataLoadTime() const
Get data load time.
double getCumulatedSimulationTime() const
Get simulation time (time loop) accumulated over all legs.
RealMatrix & getPmlX()
Get PML in x.
RealMatrix & getUzSgz()
Get velocity matrix on staggered grid in z direction.
RealMatrix & getDtRho0Sgz()
Get dt * rho0Sgz matrix (time step size * ambient velocity on staggered grid in z direction)...
Class implementing 3D and 1D Real-To-Complex and Complex-To-Real transforms using FFTW interface...
void saveCheckpointData()
Save checkpoint data and flush aggregated outputs into the output file.
Velocity z source input data.
Non uniform grid acoustic velocity in y.
Class implementing the matrix container.
RealMatrix & getRho0()
Get ambient density matrix.
RealMatrix & getAbsorbEta()
Get absorbing coefficient Eta.
Temporary matrix for 1D fft in y.
Non uniform grid acoustic velocity on staggered grid x.
ComplexMatrix & getDdzKShiftPos()
Get positive Fourier shift in z.
TimeMeasure mTotalTime
Total time of the simulation.
RealMatrix & getRhoZ()
Get density matrix in z direction.
void computeVelocityHomogeneousUniform()
Compute acoustic velocity for homogeneous medium and a uniform grid.
Transducer source input data.
Temporary matrix for 1D fft in z.
RealMatrix & getUyShifted()
Get velocity shifted on normal grid in y direction.
MatrixContainer mMatrixContainer
Matrix container with all the matrix classes.
TimeMeasure mPostProcessingTime
Post-processing time of the simulation.
RealMatrix & getTransducerSourceInput()
Get transducer source input data (signal).
void generateKappaAndNablas()
Generate kappa matrix, absorbNabla1, absorbNabla2 for absorbing medium.
double getSimulationTime() const
Get simulation time (time loop).
RealMatrix & getAbsorbNabla1()
Get absorbing coefficient Nabla1.
double getTotalTime() const
Get total simulation time.
double getCumulatedPreProcessingTime() const
Get pre-processing time accumulated over all legs.
TimeMeasure mPreProcessingTime
Pre-processing time of the simulation.
The header file containing the class for real matrices.
Velocity source geometry data.
void computeAbsorbtionTerm(FftwComplexMatrix &fftPart1, FftwComplexMatrix &fftPart2)
Compute absorbing term with abosrbNabla1 and absorbNabla2.
virtual void loadInputData()
Load simulation data.
TimeMeasure mIterationTime
Iteration time of the simulation.
RealMatrix & getTemp2Real3D()
Get second real 3D temporary matrix.
Class storing all parameters of the simulation.
void computeInitialVelocityHeterogeneous()
Compute velocity for the initial pressure problem, heterogeneous medium, uniform grid.
void postProcessing()
Post processing, and closing the output streams.
void addInitialPressureSource()
Calculate initial pressure source.
RealMatrix & getAbsorbTau()
Get absorbing coefficient Tau.
Non uniform grid acoustic velocity in z.
void computePressureNonlinear()
Compute acoustic pressure for nonlinear case.
virtual void compute()
This method computes k-space First Order 3D simulation.
double getElapsedTime() const
Get elapsed time.
RealMatrix & getTemp3Real3D()
Get third real 3D temporary matrix.
Velocity x on staggered grid.
Class measuring elapsed time.
IndexMatrix & getSensorMaskIndex()
Get linear sensor mask (spatial geometry of the sensor).
void storeSensorData()
Store sensor data.
double getCumulatedDataLoadTime() const
Get simulation time (time loop) accumulated over all legs.
std::string getCodeName() const
Get code name - release code version.
size_t mActPercent
Percentage of the simulation done.
RealMatrix & getBOnA()
Get B on A (nonlinear coefficient).
RealMatrix & getUzShifted()
Get velocity shifted on normal grid in z direction.
double getPreProcessingTime() const
Get pre-processing time.
FftwComplexMatrix & getTempFftwZ()
Get temporary matrix for 1D fft in z.
void computeVelocityHomogeneousNonuniform()
Compute acoustic velocity for homogenous medium and nonuniform grid.
The header file containing the parameters of the simulation.
RealMatrix & getDtRho0Sgx()
Get dt * rho0Sgx matrix (time step size * ambient velocity on staggered grid in x direction)...
Pressure source input data.
Absorbing coefficient Nabla 1.
Absorbing coefficient Tau.
double getElapsedTimeOverAllLegs() const
Get cumulated elapsed time over all simulation legs.
Negative shift for non-staggered velocity in z.
RealMatrix & getC2()
Get the c^2 matrix from the container.
virtual void freeMemory()
Memory deallocation.
void computeDensityLinear()
Compute new values of acoustic density for linear case.
Negative Fourier shift in z.
double getCumulatedTotalTime() const
Get total simulation time accumulated over all legs.
The header file containing the class measuring elapsed time.
size_t get1DIndex(const size_t z, const size_t y, const size_t x, const DimensionSizes &dimensionSizes)
Compute 1D index using 3 spatial coordinates and the size of the matrix.
RealMatrix & getUxSgx()
Get velocity matrix on staggered grid in x direction.
void checkCheckpointFile()
Check the file type and the version of the checkpoint file.
RealMatrix & getPmlYSgy()
Get PML on staggered grid y.
void computeVelocitySourceTerm(RealMatrix &velocityMatrix, const RealMatrix &velocitySourceInput, const IndexMatrix &velocitySourceIndex)
Add in velocity source terms.
Negative shift for non-staggered velocity in y.
RealMatrix & getPmlZSgz()
Get PML on staggered grid z.
FftwComplexMatrix & getTempFftwX()
Get temporary matrix for 1D fft in x.
KSpaceFirstOrder3DSolver & operator=(const KSpaceFirstOrder3DSolver &)=delete
operator= not allowed for public.
void computeVelocityGradient()
Compute new values of acoustic velocity gradients.
RealMatrix & getP()
Get pressure matrix.
FftwComplexMatrix & getTempFftwY()
Get temporary matrix for 1D fft in y.
Absorbing coefficient Nabla 2.
The class for complex matrices.
void addVelocitySource()
Add in all velocity sources.
void computeC2()
Calculate square of velocity.
dt / initial velocity on staggered grid z.
RealMatrix & getDuxdx()
Get velocity gradient on in x direction.
Cuboid corners sensor mask.
ComplexMatrix & getYShiftNegR()
Get negative shift for non-staggered velocity in y.
TimeMeasure mSimulationTime
Simulation time of the simulation.
Negative Fourier shift in y.
Positive Fourier shift in y.
void computePressureLinear()
Compute acoustic pressure for linear case.
The header file containing the class for 64b integer matrices.
OutputStreamContainer mOutputStreamContainer
Output stream container.
ComplexMatrix & getDdxKShiftNeg()
Get negative Fourier shift in x.
RealMatrix & getPmlZ()
Get PML in z.
Structure with 4D dimension sizes (3 in space and 1 in time).
Non uniform grid acoustic velocity on staggered grid z.
Velocity y source input data.
virtual ~KSpaceFirstOrder3DSolver()
Destructor.
RealMatrix & getDxudxn()
Non uniform grid acoustic velocity in x.
Positive Fourier shift in z.
Class responsible for running the k-space first order 3D method.
IndexMatrix & getSensorMaskCorners()
Get cuboid corners sensor mask. (Spatial geometry of multiple sensors).
Velocity x source input data.
dt / initial velocity on staggered grid y.
double getPostProcessingTime() const
Get post-processing time.
TimeMeasure mDataLoadTime
Data load time of the simulation.
A container for output streams.
RealMatrix & getKappa()
Get the kappa matrix from the container.
Non uniform grid acoustic velocity in x.
The header file with the class for complex matrices.
void checkOutputFile()
Check the output file has the correct format and version.
void computeDensityNonliner()
Compute new values of acoustic density for nonlinear case.
RealMatrix & getDyudyn()
Non uniform grid acoustic velocity in y.
RealMatrix & getDzudzn()
Non uniform grid acoustic velocity in z.
IndexMatrix & getVelocitySourceIndex()
Get velocity source geometry data.
void computeInitialVelocityHomogeneousUniform()
Compute velocity for the initial pressure problem, homogeneous medium, uniform grid.
virtual size_t getMemoryUsage() const
Get memory usage in MB on the host side.
IndexMatrix & getPressureSourceIndex()
Get pressure source geometry data.
double getCumulatedPostProcessingTime() const
Get post-processing time accumulated over all legs.
void generateTauAndEta()
Generate absorbTau, absorbEta for heterogenous medium.
virtual void allocateMemory()
Memory allocation.
RealMatrix & getInitialPressureSourceInput()
Get initial pressure source input data (whole matrix).
void printFullCodeNameAndLicense() const
Print the code name and license.
Parameters & mParameters
Global parameters of the simulation.
T & getMatrix(const MatrixIdx matrixIdx)
Get the matrix with a specific type from the container.
Positive Fourier shift in x.
void computePressureGradient()
Compute part of the new velocity term - gradient of pressure.
Delay mask for many types sources.
RealMatrix & getPmlY()
Get PML in y.
void computeVelocityHeterogeneous()
Compute acoustic velocity for heterogeneous medium and a uniform grid.
RealMatrix & getDtRho0Sgy()
Get dt * rho0Sgy matrix (time step size * ambient velocity on staggered grid in y direction)...
RealMatrix & GetVelocityYSourceInput()
Get Velocity source input data in y direction.
RealMatrix & getDyudynSgy()
Non uniform grid acoustic velocity on staggered grid x.
Non uniform grid acoustic velocity on staggered grid y.
The header file containing the matrix container.
velocity shift for non-staggered velocity in y.
The header file of the class saving RealMatrix data into the output HDF5 file.
Negative shift for non-staggered velocity in x.
RealMatrix & getDzudznSgz()
Non uniform grid acoustic velocity on staggered grid x.
void sumPressureTermsLinearLossless()
Sum sub-terms for new pressure, linear lossless case.
The header file containing the class that implements 3D FFT using the FFTW interface.
velocity shift for non-staggered velocity in z.
RealMatrix & getPressureSourceInput()
Get pressure source input data (signal).
dt / initial velocity on staggered grid x.
Negative Fourier shift in x.
void computeMainLoop()
Compute the main time loop of the kspaceFirstOrder3D.
Velocity z on staggered grid.
The header file defining the output stream container.
void setProcessorAffinity()
Set processor affinity.
RealMatrix & getRhoY()
Get density matrix in y direction.
Velocity y on staggered grid.
void computeVelocity()
Compute new values of acoustic velocity.
RealMatrix & getUySgy()
Get velocity matrix on staggered grid in y direction.
Pressure source geometry data.
void loadElapsedTimeFromOutputFile()
Reads the header of the output file and sets the cumulative elapsed time from the first log...
RealMatrix & GetVelocityXSourceInput()
Get Velocity source input data in x direction.
RealMatrix & getUxShifted()
Get velocity shifted on normal grid in x direction.
Absorbing coefficient Eau.
ComplexMatrix & getDdxKShiftPos()
Get positive Fourier shift in x.
ComplexMatrix & getXShiftNegR()
Get negative shift for non-staggered velocity in x.
void addPressureSource()
Add in pressure source.
RealMatrix & getPmlXSgx()
Get PML on staggered grid x.
Temporary matrix for fft shift.
void printStatistics()
Print progress statistics.
RealMatrix & getTemp1Real3D()
Get first real 3D temporary matrix.
The class for 64b unsigned integers (indices). It is used for linear and cuboid corners masks to get ...
void computePressureTermsNonlinear(RealMatrix &densitySum, RealMatrix &nonlinearTerm, RealMatrix &velocityGradientSum)
Calculate three temporary sums in the new pressure formula before taking the FFT, nonlinear absorbing...
void computeInitialVelocityHomogeneousNonuniform()
Compute acoustic velocity for initial pressure problem, homogenous medium, nonuniform grid...
void sumPressureTermsNonlinear(const RealMatrix &absorbTauTerm, const RealMatrix &absorbEtaTerm, const RealMatrix &nonlinearTerm)
Sum sub-terms to calculate new pressure, after FFTs, nonlinear case.
RealMatrix & getDxudxnSgx()
Non uniform grid acoustic velocity on staggered grid x.
Temporary matrix for 1D fft in x.
void sumPressureTermsNonlinearLossless()
Sum sub-terms for new pressure, linear lossless case.
FftwComplexMatrix & getTempFftwShift()
Get temporary matrix for fft shift.
void writeOutputDataInfo()
Write statistics and header into the output file.
KSpaceFirstOrder3DSolver()
Constructor.
RealMatrix & getDuzdz()
Get velocity gradient on in z direction.
void InitializeFftwPlans()
Initialize FFTW plans.
void preProcessing()
Compute pre-processing phase.
ComplexMatrix & getZShiftNegR()
Get negative shift for non-staggered velocity in z.
void generateInitialDenisty()
Calculate dt ./ rho0 for nonuniform grids.
ComplexMatrix & getDdzKShiftNeg()
Get negative Fourier shift in z.
void computeShiftedVelocity()
compute shifted velocity for –u_non_staggered flag.
bool isTimeToCheckpoint()
Is time to checkpoint (save actual state on disk).