kspaceFirstOrder3D-OMP
1.2
The C++ implementation of the k-wave toolbox for the time-domain simulation of acoustic wave fields in 3D
|
Class responsible for running the k-space first order 3D method. More...
#include <KSpaceFirstOrder3DSolver.h>
Public Member Functions | |
KSpaceFirstOrder3DSolver () | |
Constructor. More... | |
KSpaceFirstOrder3DSolver (const KSpaceFirstOrder3DSolver &)=delete | |
Copy constructor not allowed for public. | |
virtual | ~KSpaceFirstOrder3DSolver () |
Destructor. More... | |
KSpaceFirstOrder3DSolver & | operator= (const KSpaceFirstOrder3DSolver &)=delete |
operator= not allowed for public. | |
virtual void | allocateMemory () |
Memory allocation. More... | |
virtual void | freeMemory () |
Memory deallocation. More... | |
virtual void | loadInputData () |
Load simulation data. More... | |
virtual void | compute () |
This method computes k-space First Order 3D simulation. More... | |
virtual size_t | getMemoryUsage () const |
Get memory usage in MB on the host side. More... | |
std::string | getCodeName () const |
Get code name - release code version. More... | |
void | printFullCodeNameAndLicense () const |
Print the code name and license. More... | |
void | setProcessorAffinity () |
Set processor affinity. More... | |
double | getTotalTime () const |
Get total simulation time. More... | |
double | getPreProcessingTime () const |
Get pre-processing time. More... | |
double | getDataLoadTime () const |
Get data load time. More... | |
double | getSimulationTime () const |
Get simulation time (time loop). More... | |
double | getPostProcessingTime () const |
Get post-processing time. More... | |
double | getCumulatedTotalTime () const |
Get total simulation time accumulated over all legs. More... | |
double | getCumulatedPreProcessingTime () const |
Get pre-processing time accumulated over all legs. More... | |
double | getCumulatedDataLoadTime () const |
Get simulation time (time loop) accumulated over all legs. More... | |
double | getCumulatedSimulationTime () const |
Get simulation time (time loop) accumulated over all legs. More... | |
double | getCumulatedPostProcessingTime () const |
Get post-processing time accumulated over all legs. More... | |
Protected Member Functions | |
void | InitializeFftwPlans () |
Initialize FFTW plans. More... | |
void | preProcessing () |
Compute pre-processing phase. More... | |
void | computeMainLoop () |
Compute the main time loop of the kspaceFirstOrder3D. More... | |
void | postProcessing () |
Post processing, and closing the output streams. More... | |
void | storeSensorData () |
Store sensor data. More... | |
void | writeOutputDataInfo () |
Write statistics and header into the output file. More... | |
void | saveCheckpointData () |
Save checkpoint data and flush aggregated outputs into the output file. More... | |
void | computeVelocity () |
Compute new values of acoustic velocity. More... | |
void | computeVelocityGradient () |
Compute new values of acoustic velocity gradients. More... | |
void | computeDensityNonliner () |
Compute new values of acoustic density for nonlinear case. More... | |
void | computeDensityLinear () |
Compute new values of acoustic density for linear case. More... | |
void | computePressureNonlinear () |
Compute acoustic pressure for nonlinear case. More... | |
void | computePressureLinear () |
Compute acoustic pressure for linear case. More... | |
void | addVelocitySource () |
Add in all velocity sources. More... | |
void | computeVelocitySourceTerm (RealMatrix &velocityMatrix, const RealMatrix &velocitySourceInput, const IndexMatrix &velocitySourceIndex) |
Add in velocity source terms. More... | |
void | addPressureSource () |
Add in pressure source. More... | |
void | addInitialPressureSource () |
Calculate initial pressure source. More... | |
void | addTransducerSource () |
Add transducer data source to velocity x component. More... | |
void | generateKappa () |
Generate kappa matrix for lossless media. More... | |
void | generateKappaAndNablas () |
Generate kappa matrix, absorbNabla1, absorbNabla2 for absorbing medium. More... | |
void | generateTauAndEta () |
Generate absorbTau, absorbEta for heterogenous medium. More... | |
void | generateInitialDenisty () |
Calculate dt ./ rho0 for nonuniform grids. More... | |
void | computeC2 () |
Calculate square of velocity. More... | |
void | computeInitialVelocityHeterogeneous () |
Compute velocity for the initial pressure problem, heterogeneous medium, uniform grid. More... | |
void | computeInitialVelocityHomogeneousUniform () |
Compute velocity for the initial pressure problem, homogeneous medium, uniform grid. More... | |
void | computeInitialVelocityHomogeneousNonuniform () |
Compute acoustic velocity for initial pressure problem, homogenous medium, nonuniform grid. More... | |
void | computeVelocityHeterogeneous () |
Compute acoustic velocity for heterogeneous medium and a uniform grid. More... | |
void | computeVelocityHomogeneousUniform () |
Compute acoustic velocity for homogeneous medium and a uniform grid. More... | |
void | computeVelocityHomogeneousNonuniform () |
Compute acoustic velocity for homogenous medium and nonuniform grid. More... | |
void | computePressureGradient () |
Compute part of the new velocity term - gradient of pressure. More... | |
template<bool bOnAScalarFlag, bool rho0ScalarFlag> | |
void | computePressureTermsNonlinear (RealMatrix &densitySum, RealMatrix &nonlinearTerm, RealMatrix &velocityGradientSum) |
Calculate three temporary sums in the new pressure formula before taking the FFT, nonlinear absorbing case. More... | |
void | computePressureTermsLinear (RealMatrix &densitySum, RealMatrix &velocityGradientSum) |
Calculate two temporary sums in the new pressure formula before taking the FFT, linear absorbing case. More... | |
void | computeAbsorbtionTerm (FftwComplexMatrix &fftPart1, FftwComplexMatrix &fftPart2) |
Compute absorbing term with abosrbNabla1 and absorbNabla2. More... | |
template<bool c0ScalarFlag, bool areTauAndEtaScalars> | |
void | sumPressureTermsNonlinear (const RealMatrix &absorbTauTerm, const RealMatrix &absorbEtaTerm, const RealMatrix &nonlinearTerm) |
Sum sub-terms to calculate new pressure, after FFTs, nonlinear case. More... | |
template<bool c0ScalarFlag, bool areTauAndEtaScalars> | |
void | sumPressureTermsLinear (const RealMatrix &absorbTauTerm, const RealMatrix &absorbEtaTerm, const RealMatrix &densitySum) |
Sum sub-terms to calculate new pressure, after FFTs, linear case. More... | |
template<bool c0ScalarFlag, bool nonlinearFlag, bool rho0ScalarFlag> | |
void | sumPressureTermsNonlinearLossless () |
Sum sub-terms for new pressure, linear lossless case. More... | |
void | sumPressureTermsLinearLossless () |
Sum sub-terms for new pressure, linear lossless case. More... | |
void | computeShiftedVelocity () |
compute shifted velocity for –u_non_staggered flag. More... | |
void | printStatistics () |
Print progress statistics. More... | |
bool | isTimeToCheckpoint () |
Is time to checkpoint (save actual state on disk). More... | |
bool | isCheckpointInterruption () const |
Was the loop interrupted to checkpoint? More... | |
void | checkOutputFile () |
Check the output file has the correct format and version. More... | |
void | checkCheckpointFile () |
Check the file type and the version of the checkpoint file. More... | |
void | loadElapsedTimeFromOutputFile () |
Reads the header of the output file and sets the cumulative elapsed time from the first log. More... | |
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. More... | |
RealMatrix & | getKappa () |
Get the kappa matrix from the container. More... | |
RealMatrix & | getC2 () |
Get the c^2 matrix from the container. More... | |
RealMatrix & | getP () |
Get pressure matrix. More... | |
RealMatrix & | getUxSgx () |
Get velocity matrix on staggered grid in x direction. More... | |
RealMatrix & | getUySgy () |
Get velocity matrix on staggered grid in y direction. More... | |
RealMatrix & | getUzSgz () |
Get velocity matrix on staggered grid in z direction. More... | |
RealMatrix & | getUxShifted () |
Get velocity shifted on normal grid in x direction. More... | |
RealMatrix & | getUyShifted () |
Get velocity shifted on normal grid in y direction. More... | |
RealMatrix & | getUzShifted () |
Get velocity shifted on normal grid in z direction. More... | |
RealMatrix & | getDuxdx () |
Get velocity gradient on in x direction. More... | |
RealMatrix & | getDuydy () |
Get velocity gradient on in y direction. More... | |
RealMatrix & | getDuzdz () |
Get velocity gradient on in z direction. More... | |
RealMatrix & | getDtRho0Sgx () |
Get dt * rho0Sgx matrix (time step size * ambient velocity on staggered grid in x direction). More... | |
RealMatrix & | getDtRho0Sgy () |
Get dt * rho0Sgy matrix (time step size * ambient velocity on staggered grid in y direction). More... | |
RealMatrix & | getDtRho0Sgz () |
Get dt * rho0Sgz matrix (time step size * ambient velocity on staggered grid in z direction). More... | |
RealMatrix & | getRhoX () |
Get density matrix in x direction. More... | |
RealMatrix & | getRhoY () |
Get density matrix in y direction. More... | |
RealMatrix & | getRhoZ () |
Get density matrix in z direction. More... | |
RealMatrix & | getRho0 () |
Get ambient density matrix. More... | |
ComplexMatrix & | getDdxKShiftPos () |
Get positive Fourier shift in x. More... | |
ComplexMatrix & | getDdyKShiftPos () |
Get positive Fourier shift in y. More... | |
ComplexMatrix & | getDdzKShiftPos () |
Get positive Fourier shift in z. More... | |
ComplexMatrix & | getDdxKShiftNeg () |
Get negative Fourier shift in x. More... | |
ComplexMatrix & | getDdyKShiftNeg () |
Get negative Fourier shift in y. More... | |
ComplexMatrix & | getDdzKShiftNeg () |
Get negative Fourier shift in z. More... | |
ComplexMatrix & | getXShiftNegR () |
Get negative shift for non-staggered velocity in x. More... | |
ComplexMatrix & | getYShiftNegR () |
Get negative shift for non-staggered velocity in y. More... | |
ComplexMatrix & | getZShiftNegR () |
Get negative shift for non-staggered velocity in z. More... | |
RealMatrix & | getPmlXSgx () |
Get PML on staggered grid x. More... | |
RealMatrix & | getPmlYSgy () |
Get PML on staggered grid y. More... | |
RealMatrix & | getPmlZSgz () |
Get PML on staggered grid z. More... | |
RealMatrix & | getPmlX () |
Get PML in x. More... | |
RealMatrix & | getPmlY () |
Get PML in y. More... | |
RealMatrix & | getPmlZ () |
Get PML in z. More... | |
RealMatrix & | getDxudxn () |
Non uniform grid acoustic velocity in x. More... | |
RealMatrix & | getDyudyn () |
Non uniform grid acoustic velocity in y. More... | |
RealMatrix & | getDzudzn () |
Non uniform grid acoustic velocity in z. More... | |
RealMatrix & | getDxudxnSgx () |
Non uniform grid acoustic velocity on staggered grid x. More... | |
RealMatrix & | getDyudynSgy () |
Non uniform grid acoustic velocity on staggered grid x. More... | |
RealMatrix & | getDzudznSgz () |
Non uniform grid acoustic velocity on staggered grid x. More... | |
RealMatrix & | getBOnA () |
Get B on A (nonlinear coefficient). More... | |
RealMatrix & | getAbsorbTau () |
Get absorbing coefficient Tau. More... | |
RealMatrix & | getAbsorbEta () |
Get absorbing coefficient Eta. More... | |
RealMatrix & | getAbsorbNabla1 () |
Get absorbing coefficient Nabla1. More... | |
RealMatrix & | getAbsorbNabla2 () |
Get absorbing coefficient Nabla2. More... | |
IndexMatrix & | getSensorMaskIndex () |
Get linear sensor mask (spatial geometry of the sensor). More... | |
IndexMatrix & | getSensorMaskCorners () |
Get cuboid corners sensor mask. (Spatial geometry of multiple sensors). More... | |
IndexMatrix & | getVelocitySourceIndex () |
Get velocity source geometry data. More... | |
IndexMatrix & | getPressureSourceIndex () |
Get pressure source geometry data. More... | |
IndexMatrix & | getDelayMask () |
Get delay mask for many types sources. More... | |
RealMatrix & | getTransducerSourceInput () |
Get transducer source input data (signal). More... | |
RealMatrix & | getPressureSourceInput () |
Get pressure source input data (signal). More... | |
RealMatrix & | getInitialPressureSourceInput () |
Get initial pressure source input data (whole matrix). More... | |
RealMatrix & | GetVelocityXSourceInput () |
Get Velocity source input data in x direction. More... | |
RealMatrix & | GetVelocityYSourceInput () |
Get Velocity source input data in y direction. More... | |
RealMatrix & | getVelocityZSourceInput () |
Get Velocity source input data in z direction. More... | |
RealMatrix & | getTemp1Real3D () |
Get first real 3D temporary matrix. More... | |
RealMatrix & | getTemp2Real3D () |
Get second real 3D temporary matrix. More... | |
RealMatrix & | getTemp3Real3D () |
Get third real 3D temporary matrix. More... | |
FftwComplexMatrix & | getTempFftwX () |
Get temporary matrix for 1D fft in x. More... | |
FftwComplexMatrix & | getTempFftwY () |
Get temporary matrix for 1D fft in y. More... | |
FftwComplexMatrix & | getTempFftwZ () |
Get temporary matrix for 1D fft in z. More... | |
FftwComplexMatrix & | getTempFftwShift () |
Get temporary matrix for fft shift. More... | |
Private Attributes | |
MatrixContainer | mMatrixContainer |
Matrix container with all the matrix classes. | |
OutputStreamContainer | mOutputStreamContainer |
Output stream container. | |
Parameters & | mParameters |
Global parameters of the simulation. | |
size_t | mActPercent |
Percentage of the simulation done. | |
TimeMeasure | mTotalTime |
Total time of the simulation. | |
TimeMeasure | mPreProcessingTime |
Pre-processing time of the simulation. | |
TimeMeasure | mDataLoadTime |
Data load time of the simulation. | |
TimeMeasure | mSimulationTime |
Simulation time of the simulation. | |
TimeMeasure | mPostProcessingTime |
Post-processing time of the simulation. | |
TimeMeasure | mIterationTime |
Iteration time of the simulation. | |
Class responsible for running the k-space first order 3D method. This class maintain the whole k-wave (implements the time loop).
Definition at line 57 of file KSpaceFirstOrder3DSolver.h.
KSpaceFirstOrder3DSolver::KSpaceFirstOrder3DSolver | ( | ) |
Constructor of the class.
Definition at line 74 of file KSpaceFirstOrder3DSolver.cpp.
|
virtual |
Destructor of the class.
Definition at line 92 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Calculate p0 source when necessary.
Matlab code:
% add the initial pressure to rho as a mass source p = source.p0; rhox = source.p0 ./ (3 .* c.^2); rhoy = source.p0 ./ (3 .* c.^2); rhoz = source.p0 ./ (3 .* c.^2); % compute u(t = t1 + dt/2) based on the assumption u(dt/2) = -u(-dt/2) % which forces u(t = t1) = 0 ux_sgx = dt .* rho0_sgx_inv .* real(ifftn( bsxfun(@times, ddx_k_shift_pos, kappa .* fftn(p)) )) / 2; uy_sgy = dt .* rho0_sgy_inv .* real(ifftn( bsxfun(@times, ddy_k_shift_pos, kappa .* fftn(p)) )) / 2; uz_sgz = dt .* rho0_sgz_inv .* real(ifftn( bsxfun(@times, ddz_k_shift_pos, kappa .* fftn(p)) )) / 2;
Definition at line 1465 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Add in pressure source.
Definition at line 1399 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Add transducer data source to velocity x component.
Definition at line 1518 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Add u source to the particle velocity.
Definition at line 1338 of file KSpaceFirstOrder3DSolver.cpp.
|
virtual |
The method allocates the matrix container, creates all matrices and creates all output streams (however not allocating memory).
Definition at line 102 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
ios::failure | - If an error happens |
Check the file type and the version of the checkpoint file.
Definition at line 2630 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
ios::failure | - If an error happens. |
Check the output file has the correct format and version.
Definition at line 2574 of file KSpaceFirstOrder3DSolver.cpp.
|
virtual |
This method computes k-space First Order 3D simulation. It launches calculation on a given dataset going through FFT initialization, pre-processing, main loop and post-processing phases.
This method computes k-space First Order 3D simulation.
Definition at line 226 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
[in,out] | fftPart1 | - fftPart1 = absorbNabla1 .* fftPart1 |
[in,out] | fftPart2 | - fftPart1 = absorbNabla1 .* fftPart2 |
Compute absorbing term with abosrbNabla1 and absorbNabla2.
Definition at line 2245 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Compute c^2.
Definition at line 1763 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Calculate new values of acoustic density for linear case (rhoX, rhoy and rhoZ).
Matlab code:
rhox = bsxfun(@times, pml_x, bsxfun(@times, pml_x, rhox) - dt .* rho0 .* duxdx); rhoy = bsxfun(@times, pml_y, bsxfun(@times, pml_y, rhoy) - dt .* rho0 .* duydy); rhoz = bsxfun(@times, pml_z, bsxfun(@times, pml_z, rhoz) - dt .* rho0 .* duzdz);
Definition at line 1060 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Calculate new values of acoustic density for nonlinear case (rhoX, rhoy and rhoZ).
Matlab code:
rho0_plus_rho = 2 .* (rhox + rhoy + rhoz) + rho0; rhox = bsxfun(@times, pml_x, bsxfun(@times, pml_x, rhox) - dt .* rho0_plus_rho .* duxdx); rhoy = bsxfun(@times, pml_y, bsxfun(@times, pml_y, rhoy) - dt .* rho0_plus_rho .* duydy); rhoz = bsxfun(@times, pml_z, bsxfun(@times, pml_z, rhoz) - dt .* rho0_plus_rho .* duzdz);
Definition at line 981 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Matlab code:
ux_sgx = dt ./ rho0_sgx .* ifft(ux_sgx). uy_sgy = dt ./ rho0_sgy .* ifft(uy_sgy). uz_sgz = dt ./ rho0_sgz .* ifft(uz_sgz).
Compute acoustic velocity for initial pressure problem.
Definition at line 1781 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Matlab code:
ux_sgx = dt ./ rho0_sgx .* dxudxn_sgx .* ifft(ux_sgx) uy_sgy = dt ./ rho0_sgy .* dyudxn_sgy .* ifft(uy_sgy) uz_sgz = dt ./ rho0_sgz .* dzudzn_sgz .* ifft(uz_sgz)
Compute acoustic velocity for initial pressure problem, homogenous medium, nonuniform grid.
Definition at line 1841 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Matlab code:
ux_sgx = dt ./ rho0_sgx .* ifft(ux_sgx). uy_sgy = dt ./ rho0_sgy .* ifft(uy_sgy). uz_sgz = dt ./ rho0_sgz .* ifft(uz_sgz).
Compute velocity for the initial pressure problem, homogeneous medium, uniform grid.
Definition at line 1813 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Compute the main time loop of KSpaceFirstOrder3D.
Definition at line 610 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Compute part of the new velocity term - gradient of pressure. Matlab code:
bsxfun(\@times, ddx_k_shift_pos, kappa .* fftn(p))
Definition at line 2112 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Compute new p for linear case.
Matlab code:
case 'lossless' % calculate p using a linear adiabatic equation of state p = c.^2 .* (rhox + rhoy + rhoz); case 'absorbing' % calculate p using a linear absorbing equation of state p = c.^2 .* ( ... (rhox + rhoy + rhoz) ... + absorb_tau .* real(ifftn( absorb_nabla1 .* fftn(rho0 .* (duxdx + duydy + duzdz)) )) ... - absorb_eta .* real(ifftn( absorb_nabla2 .* fftn(rhox + rhoy + rhoz) )) ... );
Definition at line 1287 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Compute acoustic pressure for non-linear case.
Matlab code:
case 'lossless' % calculate p using a nonlinear adiabatic equation of state p = c.^2 .* (rhox + rhoy + rhoz + medium.BonA .* (rhox + rhoy + rhoz).^2 ./ (2 .* rho0)); case 'absorbing' % calculate p using a nonlinear absorbing equation of state p = c.^2 .* (... (rhox + rhoy + rhoz) ... + absorb_tau .* real(ifftn( absorb_nabla1 .* fftn(rho0 .* (duxdx + duydy + duzdz)) ))... - absorb_eta .* real(ifftn( absorb_nabla2 .* fftn(rhox + rhoy + rhoz) ))... + medium.BonA .*(rhox + rhoy + rhoz).^2 ./ (2 .* rho0) ... );
Definition at line 1146 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
[out] | densitySum | - rhoxSgx + rhoySgy + rhozSgz |
[out] | velocityGradientSum | - rho0* (duxdx + duydy + duzdz) |
Calculate two temporary sums in the new pressure formula, linear absorbing case.
Definition at line 2198 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
bOnAScalarFlag | - is nonlinearity homogenous? |
rho0ScalarFlag | - is density homogeneous? |
[out] | densitySum | - rhoX + rhoY + rhoZ |
[out] | nonlinearTerm | - BOnA + densitySum ^2 / 2 * rho0 |
[out] | velocityGradientSum | - rho0* (duxdx + duydy + duzdz) |
Calculate three temporary sums in the new pressure formula non-linear absorbing case.
Definition at line 2154 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Calculated shifted velocities.
Matlab code:
ux_shifted = real(ifft(bsxfun(\@times, x_shift_neg, fft(ux_sgx, [], 1)), [], 1)); uy_shifted = real(ifft(bsxfun(\@times, y_shift_neg, fft(uy_sgy, [], 2)), [], 2)); uz_shifted = real(ifft(bsxfun(\@times, z_shift_neg, fft(uz_sgz, [], 3)), [], 3));
Definition at line 2428 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Compute new values of acoustic velocity in all three dimensions (UxSgx, UySgy, UzSgz).
Matlab code:
p_k = fftn(p); ux_sgx = bsxfun(@times, pml_x_sgx, ... bsxfun(@times, pml_x_sgx, ux_sgx) ... - dt .* rho0_sgx_inv .* real(ifftn( bsxfun(@times, ddx_k_shift_pos, kappa .* fftn(p)) )) ... ); uy_sgy = bsxfun(@times, pml_y_sgy, ... bsxfun(@times, pml_y_sgy, uy_sgy) ... - dt .* rho0_sgy_inv .* real(ifftn( bsxfun(@times, ddy_k_shift_pos, kappa .* fftn(p)) )) ... ); uz_sgz = bsxfun(@times, pml_z_sgz, ... bsxfun(@times, pml_z_sgz, uz_sgz) ... - dt .* rho0_sgz_inv .* real(ifftn( bsxfun(@times, ddz_k_shift_pos, kappa .* fftn(p)) )) ... );
Definition at line 864 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Compute new values for duxdx, duydy, duzdz.
Definition at line 895 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Matlab code:
ux_sgx = bsxfun(@times, pml_x_sgx, bsxfun(@times, pml_x_sgx, ux_sgx) - dt .* rho0_sgx_inv .* real(ifftX) uy_sgy = bsxfun(@times, pml_y_sgy, bsxfun(@times, pml_y_sgy, uy_sgy) - dt .* rho0_sgy_inv .* real(ifftY) uz_sgz = bsxfun(@times, pml_z_sgz, bsxfun(@times, pml_z_sgz, uz_sgz) - dt .* rho0_sgz_inv .* real(ifftZ)
Compute acoustic velocity for heterogeneous medium and a uniform grid, x direction.
Definition at line 1884 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Matlab code:
ux_sgx = bsxfun(@times, pml_x_sgx, bsxfun(@times, pml_x_sgx, ux_sgx) ... - dt .* rho0_sgx_inv .* dxudxnSgx.* real(ifftX)) uy_sgy = bsxfun(@times, pml_y_sgy, bsxfun(@times, pml_y_sgy, uy_sgy) ... - dt .* rho0_sgy_inv .* dyudynSgy.* real(ifftY) uz_sgz = bsxfun(@times, pml_z_sgz, bsxfun(@times, pml_z_sgz, uz_sgz) - dt .* rho0_sgz_inv .* dzudznSgz.* real(ifftZ)
Compute acoustic velocity for homogenous medium and nonuniform grid, x direction.
Definition at line 2031 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Matlab code:
ux_sgx = bsxfun(@times, pml_x_sgx, bsxfun(@times, pml_x_sgx, ux_sgx) - dt .* rho0_sgx_inv .* real(ifftX) uy_sgy = bsxfun(@times, pml_y_sgy, bsxfun(@times, pml_y_sgy, uy_sgy) - dt .* rho0_sgy_inv .* real(ifftY) uz_sgz = bsxfun(@times, pml_z_sgz, bsxfun(@times, pml_z_sgz, uz_sgz) - dt .* rho0_sgz_inv .* real(ifftZ)
Compute acoustic velocity for homogeneous medium and a uniform grid.
Definition at line 1959 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
[in] | velocityMatrix | - Velocity matrix to add the source in. |
[in] | velocitySourceInput | - Source input to add. |
[in] | velocitySourceIndex | - Source geometry index matrix. |
Add in velocity source terms.
Definition at line 1362 of file KSpaceFirstOrder3DSolver.cpp.
|
virtual |
The method frees all memory allocated by the class.
Definition at line 122 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Prepare dt./ rho0 for non-uniform grid.
Definition at line 1726 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Generate kappa matrix for lossless medium.
Definition at line 1540 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Generate kappa, absorb_nabla1, absorb_nabla2 for absorbing medium.
Definition at line 1591 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Generate absorbTau and absorbEta in for heterogenous medium.
Definition at line 1658 of file KSpaceFirstOrder3DSolver.cpp.
|
inlineprotected |
[in] | z | - z coordinate |
[in] | y | - y coordinate |
[in] | x | - x coordinate |
[in] | dimensionSizes | - Size of the matrix. |
Definition at line 2704 of file KSpaceFirstOrder3DSolver.cpp.
|
inlineprotected |
Definition at line 798 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 807 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 815 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 790 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 782 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 451 of file KSpaceFirstOrder3DSolver.h.
std::string KSpaceFirstOrder3DSolver::getCodeName | ( | ) | const |
Get release code version.
Definition at line 370 of file KSpaceFirstOrder3DSolver.cpp.
|
inline |
Definition at line 150 of file KSpaceFirstOrder3DSolver.h.
|
inline |
Definition at line 160 of file KSpaceFirstOrder3DSolver.h.
|
inline |
Definition at line 145 of file KSpaceFirstOrder3DSolver.h.
|
inline |
Definition at line 155 of file KSpaceFirstOrder3DSolver.h.
|
inline |
Definition at line 140 of file KSpaceFirstOrder3DSolver.h.
|
inline |
Definition at line 124 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 630 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 606 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 638 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 614 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 646 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 622 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 857 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 547 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 555 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 563 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 521 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 529 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 537 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 732 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 756 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 740 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 764 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 748 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 772 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 883 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 442 of file KSpaceFirstOrder3DSolver.h.
|
virtual |
Get peak memory usage.
Definition at line 340 of file KSpaceFirstOrder3DSolver.cpp.
|
inlineprotected |
Definition at line 460 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 706 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 681 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 714 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 689 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 722 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 697 of file KSpaceFirstOrder3DSolver.h.
|
inline |
Definition at line 134 of file KSpaceFirstOrder3DSolver.h.
|
inline |
Definition at line 119 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 849 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 875 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 596 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 572 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 580 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 588 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 833 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 825 of file KSpaceFirstOrder3DSolver.h.
|
inline |
Definition at line 129 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 919 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 927 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 935 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 968 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 944 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 952 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 960 of file KSpaceFirstOrder3DSolver.h.
|
inline |
Definition at line 114 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 867 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 470 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 495 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 478 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 503 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 486 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 511 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 841 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 892 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 900 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 908 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 655 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 663 of file KSpaceFirstOrder3DSolver.h.
|
inlineprotected |
Definition at line 671 of file KSpaceFirstOrder3DSolver.h.
|
protected |
Initialize FFTW plans.
Definition at line 463 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Was the loop interrupted to checkpoint?
Definition at line 2565 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Is time to checkpoint?
Definition at line 2551 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Restore cumulated elapsed time from the output file.
Definition at line 2684 of file KSpaceFirstOrder3DSolver.cpp.
|
virtual |
If checkpointing is enabled, this may include reading data from checkpoint and output file.
Load data from the input file provided by the Parameter class and creates the output time series streams.
Definition at line 132 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Post processing the quantities, closing the output streams and storing the sensor mask.
Definition at line 678 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Initialize all indices, pre-compute constants such as c^2, rho0Sgx * dt and create kappa, absorbEta, absorbTau, absorbNabla1, absorbNabla2 matrices.
Compute pre-processing phase.
Definition at line 537 of file KSpaceFirstOrder3DSolver.cpp.
void KSpaceFirstOrder3DSolver::printFullCodeNameAndLicense | ( | ) | const |
Print full code name and the license.
Definition at line 380 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Print progress statistics.
Definition at line 2515 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Save checkpoint data into the checkpoint file, flush aggregated outputs into the output file.
Definition at line 773 of file KSpaceFirstOrder3DSolver.cpp.
void KSpaceFirstOrder3DSolver::setProcessorAffinity | ( | ) |
Set processor affinity.
Definition at line 434 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Store sensor data.
Definition at line 719 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
c0ScalarFlag | - is sound speed homogeneous? |
areTauAndEtaScalars | - are absorbTau and absorbEeta homogeneous? |
[in] | absorbTauTerm | - tau component |
[in] | absorbEtaTerm | - eta component of the pressure term |
[in] | densitySum | - Sum of three components of density (rhoXSgx + rhoYSgy + rhoZSgx) |
Sum sub-terms to calculate new pressure, after FFTs, linear case.
Definition at line 2308 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Sum sub-terms for new pressure, linear lossless case.
Definition at line 2383 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Sum sub-terms to calculate new pressure, after FFTs, non-linear case.
c0ScalarFlag | - is sound speed homogeneous? |
areTauAndEtaScalars | - are absorbTau and absorbEeta scalars |
[in] | absorbTauTerm | - tau component |
[in] | absorbEtaTerm | - eta component of the pressure term |
[in] | nonlinearTerm | - rho0 * (duxdx + duydy + duzdz) |
Definition at line 2269 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
c0ScalarFlag | - is sound speed homogeneous? |
nonlinearFlag | - is nonlinearity homogeneous? |
rho0ScalarFlag | - is density homogeneous? |
Sum sub-terms for new p, nonlinear lossless case.
Definition at line 2347 of file KSpaceFirstOrder3DSolver.cpp.
|
protected |
Write statistics and the header into the output file.
Definition at line 736 of file KSpaceFirstOrder3DSolver.cpp.