kspaceFirstOrder3D-OMP  1.2
The C++ implementation of the k-wave toolbox for the time-domain simulation of acoustic wave fields in 3D
Parameters.h
Go to the documentation of this file.
1 /**
2  * @file Parameters.h
3  *
4  * @author Jiri Jaros \n
5  * Faculty of Information Technology \n
6  * Brno University of Technology \n
7  * jarosjir@fit.vutbr.cz
8  *
9  * @brief The header file containing the parameters of the simulation.
10  *
11  * @version kspaceFirstOrder3D 2.16
12  *
13  * @date 08 December 2011, 16:34 (created) \n
14  * 04 September 2017, 11:13 (revised)
15  *
16  * @copyright Copyright (C) 2017 Jiri Jaros and Bradley Treeby.
17  *
18  * This file is part of the C++ extension of the [k-Wave Toolbox](http://www.k-wave.org).
19  *
20  * This file is part of the k-Wave. k-Wave is free software: you can redistribute it and/or modify it under the terms
21  * of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the
22  * License, or (at your option) any later version.
23  *
24  * k-Wave is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
25  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
26  * more details.
27  *
28  * You should have received a copy of the GNU Lesser General Public License along with k-Wave.
29  * If not, see [http://www.gnu.org/licenses/](http://www.gnu.org/licenses/).
30  */
31 
32 
33 #ifndef PARAMETERS_H
34 #define PARAMETERS_H
35 
36 #include <string>
37 
39 #include <Utils/DimensionSizes.h>
40 #include <Hdf5/Hdf5File.h>
41 #include <Hdf5/Hdf5FileHeader.h>
42 
43 /**
44  * @class Parameters
45  * @brief Class storing all parameters of the simulation.
46  * @details Class storing all parameters of the simulation.
47  * @warning This is a singleton class.
48  *
49  */
51 {
52  public:
53 
54  /**
55  * @enum SensorMaskType
56  * @brief Sensor mask type (linear or cuboid corners).
57  * @details Sensor mask type (linear or cuboid corners).
58  */
59  enum class SensorMaskType
60  {
61  /// Linear sensor mask.
62  kIndex = 0,
63  /// Cuboid corners sensor mask.
64  kCorners = 1
65  };
66 
67  /// Copy constructor not allowed.
68  Parameters(const Parameters&) = delete;
69  /// Destructor.
70  virtual ~Parameters();
71  /// operator= not allowed.
72  Parameters& operator=(const Parameters&) = delete;
73 
74  /**
75  * @brief Get instance of the singleton class
76  * @return The only instance of the class.
77  */
78  static Parameters& getInstance();
79 
80  /**
81  * @brief Parse command line and read scalar values form the input file.
82  * @param [in] argc - Number of commandline parameters.
83  * @param [in] argv - Commandline parameters.
84  * @throw std::invalid_argument - If sampling is supposed to start out of the simulation time span.
85  */
86  void init(int argc, char** argv);
87 
88  /// Print the simulation setup (all parameters).
89  void printSimulatoinSetup();
90 
91  /**
92  * @brief Shall the code print version and exit?
93  * @return True if the flag is set.
94  */
96 
97  /**
98  * @brief Read scalar values from the input HDF5 file.
99  * @throw ios:failure - If the file cannot be open or is of a wrong type or version.
100  * @throw std::invalid_argument - If some values are not correct or not supported.
101  * @warning The file is opened in this routine and left open for further use.
102  */
104  /**
105  * @brief Save scalar values into the output HDF5 file.
106  * @throw ios:failure - If the output file is closed.
107  * @warning The file is expected to be open.
108  */
110 
111  /**
112  * @brief Get git hash of the code
113  * @return Git hash compiled in using -D parameter.
114  */
115  std::string getGitHash() const;
116 
117  /**
118  * @brief Get number of CPU threads to use.
119  * @return Number of CPU threads to use.
120  */
122 
123  /**
124  * @brief Get compression level.
125  * @return Compression level value for output and checkpoint files.
126  */
128 
129  /**
130  * @brief Get progress print interval.
131  * @return How often to print progress.
132  */
134 
135 
136  /**
137  * @brief Is checkpoint enabled?
138  * @return true if checkpointing is enabled.
139  */
141  /**
142  * @brief Get checkpoint interval.
143  * @return Checkpoint interval in seconds.
144  */
146 
147 
148  //---------------------------------------------------- Files -----------------------------------------------------//
149  /**
150  * @brief Get input file handle.
151  * @return Handle to the input file.
152  */
154  /**
155  * @brief Get output file handle.
156  * @return Handle to the output file.
157  */
159  /**
160  * @brief Get checkpoint file handle.
161  * @return Handle to the checkpoint file.
162  */
164  /**
165  * @brief Get file header handle.
166  * @return Handle to the file header.
167  */
169 
170  /**
171  * @brief Get input file name.
172  * @return Input file name
173  */
174  std::string getInputFileName() const { return mCommandLineParameters.getInputFileName(); };
175  /**
176  * @brief Get output file name.
177  * @return Output file name.
178  */
179  std::string getOutputFileName() const { return mCommandLineParameters.getOutputFileName(); };
180  /**
181  * @brief Get checkpoint file name.
182  * @return Checkpoint file name
183  */
185 
186  //-------------------------------------------- Simulation dimensions ---------------------------------------------//
187  /**
188  * @brief Get full dimension sizes of the simulation (real classes).
189  * @return Dimension sizes of 3D real matrices.
190  */
192  ///
193  /**
194  * @brief Get reduced dimension sizes of the simulation (complex classes).
195  * @return Dimension sizes of reduced complex 3D matrices.
196  */
198 
199  /**
200  * @brief Get total number of time steps.
201  * @return Total number of time steps.
202  */
203  size_t getNt() const { return mNt; };
204  /**
205  * @brief Get actual simulation time step.
206  * @return Actual time step.
207  */
208  size_t getTimeIndex() const { return mTimeIndex; };
209  /**
210  * @brief Set simulation time step - should be used only when recovering from checkpoint.
211  * @param [in] timeIndex - Actual time step.
212  */
213  void setTimeIndex(const size_t timeIndex) { mTimeIndex = timeIndex; };
214  /// Increment simulation time step.
216 
217  //----------------------------------------------- Grid parameters ------------------------------------------------//
218  /**
219  * @brief Get time step size.
220  * @return dt value.
221  */
222  float getDt() const { return mDt; };
223  /**
224  * @brief Get spatial displacement in x.
225  * @return dx value.
226  */
227  float getDx() const { return mDx; };
228  /**
229  * @brief Get spatial displacement in y.
230  * @return dy value.
231  */
232  float getDy() const { return mDy; };
233  /**
234  * @brief Get spatial displacement in z.
235  * @return dz value
236  */
237  float getDz() const { return mDz; };
238 
239  //------------------------------------------- Sound speed and density --------------------------------------------//
240  /**
241  * @brief Get reference sound speed.
242  * @return Reference sound speed.
243  */
244  float getCRef() const { return mCRef; };
245  /**
246  * @brief Is sound speed in the medium homogeneous (scalar value)?
247  * @return True if scalar.
248  */
249  bool getC0ScalarFlag() const { return mC0ScalarFlag; };
250  /**
251  * @brief Get scalar value of sound speed.
252  * @return Sound speed.
253  */
254  float getC0Scalar() const { return mC0Scalar; };
255  /**
256  * @brief Get scalar value of sound speed squared.
257  * @return Sound speed.
258  */
259  float getC2Scalar() const { return mC0Scalar * mC0Scalar; };
260 
261 
262  /**
263  * @brief Is density in the medium homogeneous (scalar value)?
264  * @return True if scalar.
265  */
266  bool getRho0ScalarFlag() const { return mRho0ScalarFlag; };
267  /**
268  * @brief Get value of homogeneous medium density.
269  * @return Density.
270  */
271  float getRho0Scalar() const { return mRho0Scalar; };
272  /**
273  * @brief Get value of homogeneous medium density on staggered grid in x direction.
274  * @return Staggered density.
275  */
276  float getRho0SgxScalar() const { return mRho0SgxScalar; };
277  /**
278  * @brief Get value of dt / rho0Sgx.
279  * @return Staggered density.
280  */
281  float getDtRho0SgxScalar() const { return mDt / mRho0SgxScalar; };
282  /**
283  * @brief Get value of homogeneous medium density on staggered grid in y direction.
284  * @return Staggered density.
285  */
286  float getRho0SgyScalar() const { return mRho0SgyScalar; };
287  /**
288  * @brief Get value of dt / rho0Sgy.
289  * @return Staggered density.
290  */
291  float getDtRho0SgyScalar() const { return mDt / mRho0SgyScalar; };
292  /**
293  * @brief Get value of homogeneous medium density on staggered grid in z direction.
294  * @return Staggered density.
295  */
296  float getRho0SgzScalar() const { return mRho0SgzScalar; };
297  /**
298  * @brief Get value of dt / rho0Sgz.
299  * @return Staggered density.
300  */
301  float getDtRho0SgzScalar() const { return mDt / mRho0SgzScalar; };
302 
303  //----------------------------------------- Absorption and nonlinearity ------------------------------------------//
304 
305  /**
306  * @brief Enable non uniform grid? - not implemented yet.
307  * @return Non uniform flag.
308  */
309  size_t getNonUniformGridFlag() const { return mNonUniformGridFlag; };
310  /**
311  * @brief Is the simulation absrobing or lossless?
312  * @return 0 if the medium is lossless, 1 otherwise.
313  */
314  size_t getAbsorbingFlag() const { return mAbsorbingFlag; };
315  /**
316  * @brief Is the wave propagation nonlinear?
317  * @return 0 if the simulation is linear, 1 otherwise.
318  */
319  size_t getNonLinearFlag() const { return mNonLinearFlag; };
320 
321  /**
322  * @brief Is alpha absorption coefficient homogeneous (scalar value)?
323  * @return True if scalar.
324  */
326  /**
327  * @brief Get value of alpha absorption coefficient.
328  * @return Alpha absorption coefficient.
329  */
330  float getAlphaCoeffScalar() const { return mAlphaCoeffScalar; };
331  /**
332  * @brief Get alpha power value for the absorption law.
333  * @return Alpha power value.
334  */
335  float getAlphaPower() const { return mAlphaPower; };
336  /**
337  * @brief Get absorb eta coefficient for homogeneous medium (scalar value)?
338  * @return Absorb eta coefficient.
339  */
340  float getAbsorbEtaScalar() const { return mAbsorbEtaScalar; };
341  /**
342  * @brief Set absorb eta coefficient for homogeneous medium (scalar value).
343  * @param [in] absrobEta - New value for absorb eta
344  */
345  void setAbsorbEtaScalar(const float absrobEta) { mAbsorbEtaScalar = absrobEta; };
346  /**
347  * @brief Get absorb tau coefficient for homogeneous medium.
348  * @return Absorb tau coefficient.
349  */
350  float getAbsorbTauScalar() const { return mAbsorbTauScalar; };
351  /**
352  * @brief Set absorb tau coefficient for homogeneous medium (scalar value).
353  * @param [in] absorbTau - New value for absorb tau.
354  */
355  void setAbsorbTauScalar(const float absorbTau) { mAbsorbTauScalar = absorbTau; };
356 
357  /**
358  * @brief Is nonlinear coefficient homogeneous in the medium (scalar value)?
359  * @return True if scalar
360  */
361  bool getBOnAScalarFlag() const { return mBOnAScalarFlag; };
362  /**
363  * @brief Get nonlinear coefficient for homogenous medium.
364  * @return Nonlinear coefficient.
365  */
366  float getBOnAScalar() const { return mBOnAScalar; };
367 
368  //------------------------------------------ Perfectly matched layer ---------------------------------------------//
369  /**
370  * @brief Get depth of the perfectly matched layer in x.
371  * @return PML size in x.
372  */
373  size_t getPmlXSize() const { return mPmlXSize; };
374  /**
375  * @brief Get depth of the perfectly matched layer in y.
376  * @return PML size in y.
377  */
378  size_t getPmlYSize() const { return mPmlYSize; };
379  /**
380  * @brief Get depth of the perfectly matched layer in z.
381  * @return PML size in z.
382  */
383  size_t getPmlZSize() const { return mPmlZSize; };
384 
385  /**
386  * @brief Get Perfectly matched layer attenuation in x, not implemented.
387  * @return Attenuation for PML in x.
388  */
389  float getPmlXAlpha() const { return mPmlXAlpha; };
390  /**
391  * @brief Get Perfectly matched layer attenuation in y, not implemented.
392  * @return Attenuation for PML in y.
393  */
394  float getPmlYAlpha() const { return mPmlYAlpha; };
395  /**
396  * @brief Get Perfectly matched layer attenuation in z , not implemented.
397  * @return Attenuation for PML in z.
398  */
399  float getPmlZAlpha() const { return mPmlZAlpha; };
400 
401 
402  //-------------------------------------------------- Sources -----------------------------------------------------//
403  /**
404  * @brief Get pressure source flag.
405  * @return 0 if the source is disabled.
406  * @return Length of the input signal in time steps.
407  */
408  size_t getPressureSourceFlag() const { return mPressureSourceFlag; };
409  /**
410  * @brief Get initial pressure source flag (p0).
411  * @return 0 if the source is disabled, 1 otherwise.
412  */
414  /**
415  * @brief Get transducer source flag.
416  * @return 0 if the transducer is disabled.
417  * @return Length of the input signal in time steps.
418  */
419  size_t getTransducerSourceFlag() const { return mTransducerSourceFlag; };
420  /**
421  * @brief Get velocity in x source flag.
422  * @return 0 if the source is disabled.
423  * @return Length of the input signal in time steps.
424  */
425  size_t getVelocityXSourceFlag() const { return mVelocityXSourceFlag; };
426  /**
427  * @brief Get velocity in y source flag.
428  * @return 0 if the source is disabled.
429  * @return Length of the input signal in time steps.
430  */
431  size_t getVelocityYSourceFlag() const { return mVelocityYSourceFlag; };
432  /**
433  * @brief Get velocity in z source flag.
434  * @return 0 if the source is disabled.
435  * @return Length of the input signal in time steps.
436  */
437  size_t getVelocityZSourceFlag() const { return mVelocityZSourceFlag; };
438 
439 
440  /**
441  * @brief Get spatial size of the pressure source.
442  * @return Size of the pressure source in grid points.
443  */
445  /**
446  * @brief Get spatial size of the transducer source.
447  * @return Size of the transducer source in grid points.
448  */
450  /**
451  * @brief Get spatial size of the velocity source.
452  * @return Size of the velocity source in grid points.
453  */
455 
456 
457  /**
458  * @brief Get pressure source mode.
459  * @return Pressure source mode (Dirichlet or additive).
460  */
461  size_t getPressureSourceMode() const { return mPressureSourceMode; };
462  /**
463  * @brief Get number of time series in the pressure source.
464  * @return Number of time series in the pressure source.
465  */
466  size_t getPressureSourceMany() const { return mPressureSourceMany; };
467 
468  /**
469  * @brief Get velocity source mode.
470  * @return Pressure source mode (Dirichlet or additive).
471  */
472  size_t getVelocitySourceMode() const { return mVelocitySourceMode; };
473  /**
474  * @brief Get number of time series in the velocity sources.
475  * @return Number of time series in the velocity sources.
476  */
477  size_t getVelocitySourceMany() const { return mVelocitySourceMany; };
478 
479  //-------------------------------------------------- Sensors -----------------------------------------------------//
480  /**
481  * @brief Get sensor mask type (linear or corners).
482  * @return Sensor mask type.
483  */
485  /**
486  * @brief Get spatial size of the index sensor mask.
487  * @return Number of grid points.
488  */
489  size_t getSensorMaskIndexSize() const { return mSensorMaskIndexSize ;}
490  /**
491  * @brief Get number of cuboids the sensor is composed of.
492  * @return Number of cuboids.
493  */
495  /**
496  * @brief Get start time index when sensor data collection begins
497  * @return When to start sampling data.
498  */
500 
501  /**
502  * @brief Is -p or --p_raw specified at the command line?
503  * @return True if the flag is set.
504  */
506  /**
507  * @brief Is --p_rms set?
508  * @return True if the flag is set.
509  */
511  /**
512  * @brief Is --p_max set?
513  * @return True if the flag is set.
514  */
516  /**
517  * @brief Is --p_min set?
518  * @return True if the flag is set.
519  */
521  /**
522  * @brief Is --p_max_all set?
523  * @return True if the flag is set.
524  */
526  /**
527  * @brief Is --p_min_all set?
528  * @return true if the flag is set.
529  */
531  /**
532  * @brief Is --p_final set?
533  * @return True if the flag is set.
534  */
536 
537 
538  /**
539  * @brief Is -u or --u_raw specified at the command line?
540  * @return True if the flag is set.
541  */
543  /**
544  * @brief Is --u_non_staggered_raw set?
545  * @return True if the flag is set.
546  */
548  {
550  };
551  /**
552  * @brief Is --u_rms set?
553  * @return True if the flag is set.
554  */
556  /**
557  * @brief Is --u_max set?
558  * @return True if the flag is set.
559  */
561  /**
562  * @brief Is --u_min set?
563  * @return True if the flag is set.
564  */
566  /**
567  * @brief Is --u_max_all set?
568  * @return True if the flag is set.
569  */
571  /**
572  * @brief Is --u_min set?
573  * @return True if the flag is set.
574  */
576  /**
577  * @brief Is --u_final set?
578  * @return True if the flag is set.
579  */
581 
582  /**
583  * @brief Is --copy_mask set set?
584  * @return True if the flag is set.
585  */
587 
588 
589  protected:
590 
591  /// Constructor not allowed for public.
592  Parameters();
593 
594  private:
595  /// Class with command line parameters
597 
598  /// Handle to the input HDF5 file.
600  /// Handle to the output HDF5 file.
602  /// Handle to the checkpoint HDF5 file.
604 
605  /// Handle to file header.
607 
608  /// Full 3D dimension sizes.
610  /// Reduced 3D dimension sizes.
612 
613  /// Total number of time steps.
614  size_t mNt;
615  /// Actual time index (time step of the simulation).
616  size_t mTimeIndex;
617 
618  /// Time step size.
619  float mDt;
620  /// Spatial displacement in x.
621  float mDx;
622  /// Spatial displacement in y.
623  float mDy;
624  /// Spatial displacement in z.
625  float mDz;
626 
627  /// Reference sound speed.
628  float mCRef;
629  /// Is sound speed in the medium homogeneous?
631  /// Scalar value of sound speed.
632  float mC0Scalar;
633 
634  /// Is density in the medium homogeneous?
636  /// Homogeneous medium density.
637  float mRho0Scalar;
638  /// Homogeneous medium density on staggered grid in x direction.
640  /// Homogeneous medium density on staggered grid in y direction.
642  /// Homogeneous medium density on staggered grid in z direction.
644 
645  /// Enable non uniform grid?
647  /// Is the simulation absrobing or lossless?
649  /// Is the wave propagation nonlinear?
651 
652  /// Is alpha absorption coefficient homogeneous?
654  /// Alpha absorption coefficient.
656  /// Alpha power value for the absorption law.
657  float mAlphaPower;
658 
659  /// Absorb eta coefficient for homogeneous medium.
661  /// Absorb tau coefficient for homogeneous medium.
663 
664  /// Is nonlinear coefficient homogeneous in the medium?
666  /// Nonlinear coefficient for homogenous medium.
667  float mBOnAScalar;
668 
669  /// Depth of the perfectly matched layer in x.
670  size_t mPmlXSize;
671  /// Depth of the perfectly matched layer in y.
672  size_t mPmlYSize;
673  /// Depth of the perfectly matched layer in z.
674  size_t mPmlZSize;
675 
676  /// Perfectly matched layer attenuation in x.
677  float mPmlXAlpha;
678  /// Perfectly matched layer attenuation in y.
679  float mPmlYAlpha;
680  /// Perfectly matched layer attenuation in z.
681  float mPmlZAlpha;
682 
683  /// Pressure source flag.
685  /// Initial pressure source flag (p0).
687  /// Transducer source flag.
689 
690  /// Velocity in x source flag.
692  /// Velocity in y source flag.
694  /// Velocity in z source flag.
696 
697  /// Spatial size of the pressure source.
699  /// Spatial size of the transducer source.
701  /// Spatial size of the velocity source.
703 
704  /// Pressure source mode.
706  /// Number of time series in the pressure source.
708 
709  /// Velocity source mode.
711  /// Number of time series in the velocity sources.
713 
714  /// Sensor mask type (index / corners).
716  /// How many elements there are in the linear mask
718  /// Sensor_mask_corners_size - how many cuboids are in the mask.
720 
721  /// Singleton flag
723  /// Singleton instance
725 
726 }; // end of Parameters
727 //----------------------------------------------------------------------------------------------------------------------
728 #endif /* PARAMETERS_H */
size_t mPmlYSize
Depth of the perfectly matched layer in y.
Definition: Parameters.h:672
bool isPrintVersionOnly() const
Is –version set?
size_t mSensorMaskCornersSize
Sensor_mask_corners_size - how many cuboids are in the mask.
Definition: Parameters.h:719
void saveScalarsToOutputFile()
Save scalar values into the output HDF5 file.
Definition: Parameters.cpp:391
float mDx
Spatial displacement in x.
Definition: Parameters.h:621
bool getStoreVelocityFinalAllFlag() const
Is –u_final set?
Definition: Parameters.h:580
float getDt() const
Get time step size.
Definition: Parameters.h:222
float getRho0Scalar() const
Get value of homogeneous medium density.
Definition: Parameters.h:271
bool getStoreVelocityRmsFlag() const
Is –u_rms set?
SensorMaskType mSensorMaskType
Sensor mask type (index / corners).
Definition: Parameters.h:715
Hdf5File & getCheckpointFile()
Get checkpoint file handle.
Definition: Parameters.h:163
float getDx() const
Get spatial displacement in x.
Definition: Parameters.h:227
float mPmlZAlpha
Perfectly matched layer attenuation in z.
Definition: Parameters.h:681
size_t mVelocitySourceMany
Number of time series in the velocity sources.
Definition: Parameters.h:712
float mAbsorbTauScalar
Absorb tau coefficient for homogeneous medium.
Definition: Parameters.h:662
size_t getCompressionLevel() const
Get compression level.
Definition: Parameters.h:127
size_t getPmlYSize() const
Get depth of the perfectly matched layer in y.
Definition: Parameters.h:378
size_t getVelocitySourceMode() const
Get velocity source mode.
Definition: Parameters.h:472
float mCRef
Reference sound speed.
Definition: Parameters.h:628
bool getC0ScalarFlag() const
Is sound speed in the medium homogeneous (scalar value)?
Definition: Parameters.h:249
float getAlphaPower() const
Get alpha power value for the absorption law.
Definition: Parameters.h:335
size_t getNt() const
Get total number of time steps.
Definition: Parameters.h:203
void readScalarsFromInputFile()
Read scalar values from the input HDF5 file.
Definition: Parameters.cpp:169
float mRho0Scalar
Homogeneous medium density.
Definition: Parameters.h:637
The class to parse and store command line parameters.
bool getRho0ScalarFlag() const
Is density in the medium homogeneous (scalar value)?
Definition: Parameters.h:266
float getAbsorbEtaScalar() const
Get absorb eta coefficient for homogeneous medium (scalar value)?
Definition: Parameters.h:340
size_t mNt
Total number of time steps.
Definition: Parameters.h:614
Hdf5FileHeader & getFileHeader()
Get file header handle.
Definition: Parameters.h:168
size_t getPressureSourceIndexSize() const
Get spatial size of the pressure source.
Definition: Parameters.h:444
size_t getTransducerSourceFlag() const
Get transducer source flag.
Definition: Parameters.h:419
std::string getCheckpointFileName() const
Get checkpoint file name.
Definition: Parameters.h:184
The header file containing the HDF5 related classes.
bool getStoreVelocityMaxFlag() const
Is –u_max set?
float getRho0SgyScalar() const
Get value of homogeneous medium density on staggered grid in y direction.
Definition: Parameters.h:286
size_t getSensorMaskIndexSize() const
Get spatial size of the index sensor mask.
Definition: Parameters.h:489
bool getStoreVelocityMinAllFlag() const
Is –u_min set?
Definition: Parameters.h:575
Parameters()
Constructor not allowed for public.
Definition: Parameters.cpp:489
size_t getNonLinearFlag() const
Is the wave propagation nonlinear?
Definition: Parameters.h:319
std::string getInputFileName() const
Get input file name.
Definition: Parameters.h:174
float getDtRho0SgzScalar() const
Get value of dt / rho0Sgz.
Definition: Parameters.h:301
size_t mSensorMaskIndexSize
How many elements there are in the linear mask.
Definition: Parameters.h:717
float mRho0SgxScalar
Homogeneous medium density on staggered grid in x direction.
Definition: Parameters.h:639
size_t mVelocityZSourceFlag
Velocity in z source flag.
Definition: Parameters.h:695
bool getStorePressureMinAllFlag() const
Is –p_min_all set?
bool getStoreVelocityNonStaggeredRawFlag() const
Is –u_non_staggered_raw set?
Class storing all parameters of the simulation.
Definition: Parameters.h:50
size_t getNumberOfThreads() const
Get number of threads.
void printSimulatoinSetup()
Print the simulation setup (all parameters).
Definition: Parameters.cpp:137
float mRho0SgzScalar
Homogeneous medium density on staggered grid in z direction.
Definition: Parameters.h:643
const std::string & getOutputFileName() const
Get output file name.
Hdf5File & getOutputFile()
Get output file handle.
Definition: Parameters.h:158
size_t mTransducerSourceInputSize
Spatial size of the transducer source.
Definition: Parameters.h:700
DimensionSizes getFullDimensionSizes() const
Get full dimension sizes of the simulation (real classes).
Definition: Parameters.h:191
float mBOnAScalar
Nonlinear coefficient for homogenous medium.
Definition: Parameters.h:667
bool getStoreVelocityMinFlag() const
Is –u_min set?
Definition: Parameters.h:565
SensorMaskType
Sensor mask type (linear or cuboid corners).
Definition: Parameters.h:59
bool mC0ScalarFlag
Is sound speed in the medium homogeneous?
Definition: Parameters.h:630
size_t mTransducerSourceFlag
Transducer source flag.
Definition: Parameters.h:688
void setAbsorbTauScalar(const float absorbTau)
Set absorb tau coefficient for homogeneous medium (scalar value).
Definition: Parameters.h:355
float mDt
Time step size.
Definition: Parameters.h:619
size_t getCheckpointInterval() const
Get checkpoint interval.
Definition: Parameters.h:145
float getDtRho0SgyScalar() const
Get value of dt / rho0Sgy.
Definition: Parameters.h:291
bool isPrintVersionOnly() const
Shall the code print version and exit?
Definition: Parameters.h:95
size_t getNumberOfThreads() const
Get number of CPU threads to use.
Definition: Parameters.h:121
bool getStoreVelocityRawFlag() const
Is -u or –u_raw specified at the command line?
Definition: Parameters.h:542
bool mRho0ScalarFlag
Is density in the medium homogeneous?
Definition: Parameters.h:635
bool getStorePressureMinAllFlag() const
Is –p_min_all set?
Definition: Parameters.h:530
size_t getPressureSourceFlag() const
Get pressure source flag.
Definition: Parameters.h:408
float getC2Scalar() const
Get scalar value of sound speed squared.
Definition: Parameters.h:259
virtual ~Parameters()
Destructor.
Definition: Parameters.cpp:70
Parameters & operator=(const Parameters &)=delete
operator= not allowed.
float mAlphaCoeffScalar
Alpha absorption coefficient.
Definition: Parameters.h:655
The header file containing the class processing file headers. Detail about the file header are descri...
bool getStorePressureFinalAllFlag() const
Is –p_final set?
size_t mPmlXSize
Depth of the perfectly matched layer in x.
Definition: Parameters.h:670
bool getStoreVelocityRawFlag() const
Is –u_raw set?
size_t getNonUniformGridFlag() const
Enable non uniform grid? - not implemented yet.
Definition: Parameters.h:309
bool getStoreVelocityMinAllFlag() const
Is –u_min set?
bool getStoreVelocityNonStaggeredRawFlag() const
Is –u_non_staggered_raw set?
Definition: Parameters.h:547
Hdf5File mCheckpointFile
Handle to the checkpoint HDF5 file.
Definition: Parameters.h:603
bool mBOnAScalarFlag
Is nonlinear coefficient homogeneous in the medium?
Definition: Parameters.h:665
Hdf5File mInputFile
Handle to the input HDF5 file.
Definition: Parameters.h:599
float getPmlZAlpha() const
Get Perfectly matched layer attenuation in z , not implemented.
Definition: Parameters.h:399
bool getStoreVelocityFinalAllFlag() const
Is –u_final set?
size_t getSamplingStartTimeIndex() const
Get start time index when sensor data collection begins.
size_t getSamplingStartTimeIndex() const
Get start time index when sensor data collection begins.
Definition: Parameters.h:499
float getRho0SgzScalar() const
Get value of homogeneous medium density on staggered grid in z direction.
Definition: Parameters.h:296
CommandLineParameters mCommandLineParameters
Class with command line parameters.
Definition: Parameters.h:596
void incrementTimeIndex()
Increment simulation time step.
Definition: Parameters.h:215
size_t mVelocitySourceIndexSize
Spatial size of the velocity source.
Definition: Parameters.h:702
size_t getVelocityXSourceFlag() const
Get velocity in x source flag.
Definition: Parameters.h:425
size_t mPressureSourceIndexSize
Spatial size of the pressure source.
Definition: Parameters.h:698
Class wrapping the HDF5 routines.
Definition: Hdf5File.h:490
float getDz() const
Get spatial displacement in z.
Definition: Parameters.h:237
bool getStoreVelocityRmsFlag() const
Is –u_rms set?
Definition: Parameters.h:555
bool getStoreVelocityMaxFlag() const
Is –u_max set?
Definition: Parameters.h:560
Class for HDF5 file header.
void setTimeIndex(const size_t timeIndex)
Set simulation time step - should be used only when recovering from checkpoint.
Definition: Parameters.h:213
float getDtRho0SgxScalar() const
Get value of dt / rho0Sgx.
Definition: Parameters.h:281
bool getBOnAScalarFlag() const
Is nonlinear coefficient homogeneous in the medium (scalar value)?
Definition: Parameters.h:361
float mAbsorbEtaScalar
Absorb eta coefficient for homogeneous medium.
Definition: Parameters.h:660
DimensionSizes mReducedDimensionSizes
Reduced 3D dimension sizes.
Definition: Parameters.h:611
size_t mVelocitySourceMode
Velocity source mode.
Definition: Parameters.h:710
float getBOnAScalar() const
Get nonlinear coefficient for homogenous medium.
Definition: Parameters.h:366
Structure with 4D dimension sizes (3 in space and 1 in time).
float getRho0SgxScalar() const
Get value of homogeneous medium density on staggered grid in x direction.
Definition: Parameters.h:276
bool getStoreVelocityMaxAllFlag() const
Is –u_max_all set?
float getCRef() const
Get reference sound speed.
Definition: Parameters.h:244
float getDy() const
Get spatial displacement in y.
Definition: Parameters.h:232
size_t getInitialPressureSourceFlag() const
Get initial pressure source flag (p0).
Definition: Parameters.h:413
DimensionSizes mFullDimensionSizes
Full 3D dimension sizes.
Definition: Parameters.h:609
size_t mInitialPressureSourceFlag
Initial pressure source flag (p0).
Definition: Parameters.h:686
bool isCheckpointEnabled() const
Is checkpoint enabled?
Cuboid corners sensor mask.
Hdf5File mOutputFile
Handle to the output HDF5 file.
Definition: Parameters.h:601
float mAlphaPower
Alpha power value for the absorption law.
Definition: Parameters.h:657
bool getStorePressureMaxAllFlag() const
Is –p_max_all set?
Definition: Parameters.h:525
bool getCopySensorMaskFlag() const
Is –copy_mask set set?
Definition: Parameters.h:586
The header file containing the structure with 3D dimension sizes.
SensorMaskType getSensorMaskType() const
Get sensor mask type (linear or corners).
Definition: Parameters.h:484
const std::string & getInputFileName() const
Get input file name.
size_t getTransducerSourceInputSize() const
Get spatial size of the transducer source.
Definition: Parameters.h:449
void setAbsorbEtaScalar(const float absrobEta)
Set absorb eta coefficient for homogeneous medium (scalar value).
Definition: Parameters.h:345
bool getStorePressureMinFlag() const
Is –p_min set?
const std::string & getCheckpointFileName() const
Get Checkpoint file name.
size_t mAbsorbingFlag
Is the simulation absrobing or lossless?
Definition: Parameters.h:648
float getC0Scalar() const
Get scalar value of sound speed.
Definition: Parameters.h:254
size_t getTimeIndex() const
Get actual simulation time step.
Definition: Parameters.h:208
bool getStorePressureFinalAllFlag() const
Is –p_final set?
Definition: Parameters.h:535
size_t getCompressionLevel() const
Get compression level.
size_t getProgressPrintInterval() const
Get progress print interval.
Definition: Parameters.h:133
size_t getVelocitySourceIndexSize() const
Get spatial size of the velocity source.
Definition: Parameters.h:454
Hdf5File & getInputFile()
Get input file handle.
Definition: Parameters.h:153
bool getStorePressureRawFlag() const
Is -p or –p_raw specified at the command line?
Definition: Parameters.h:505
bool getAlphaCoeffScalarFlag() const
Is alpha absorption coefficient homogeneous (scalar value)?
Definition: Parameters.h:325
float mDz
Spatial displacement in z.
Definition: Parameters.h:625
float getPmlYAlpha() const
Get Perfectly matched layer attenuation in y, not implemented.
Definition: Parameters.h:394
float mRho0SgyScalar
Homogeneous medium density on staggered grid in y direction.
Definition: Parameters.h:641
std::string getOutputFileName() const
Get output file name.
Definition: Parameters.h:179
size_t getVelocityYSourceFlag() const
Get velocity in y source flag.
Definition: Parameters.h:431
static bool sParametersInstanceFlag
Singleton flag.
Definition: Parameters.h:722
float mDy
Spatial displacement in y.
Definition: Parameters.h:623
void init(int argc, char **argv)
Parse command line and read scalar values form the input file.
Definition: Parameters.cpp:102
size_t mPressureSourceFlag
Pressure source flag.
Definition: Parameters.h:684
float getAlphaCoeffScalar() const
Get value of alpha absorption coefficient.
Definition: Parameters.h:330
size_t getPressureSourceMany() const
Get number of time series in the pressure source.
Definition: Parameters.h:466
size_t getPressureSourceMode() const
Get pressure source mode.
Definition: Parameters.h:461
bool getStoreVelocityMaxAllFlag() const
Is –u_max_all set?
Definition: Parameters.h:570
bool getStorePressureMaxFlag() const
Is –p_max set?
size_t getVelocityZSourceFlag() const
Get velocity in z source flag.
Definition: Parameters.h:437
size_t getCheckpointInterval() const
Get checkpoint interval.
bool getStorePressureMaxAllFlag() const
Is –p_max_all set?
static Parameters * sPrametersInstance
Singleton instance.
Definition: Parameters.h:724
size_t mPressureSourceMode
Pressure source mode.
Definition: Parameters.h:705
bool getStorePressureMaxFlag() const
Is –p_max set?
Definition: Parameters.h:515
size_t getVelocitySourceMany() const
Get number of time series in the velocity sources.
Definition: Parameters.h:477
static Parameters & getInstance()
Get instance of the singleton class.
Definition: Parameters.cpp:84
The header file containing the command line parameters.
size_t getAbsorbingFlag() const
Is the simulation absrobing or lossless?
Definition: Parameters.h:314
bool getStorePressureMinFlag() const
Is –p_min set?
Definition: Parameters.h:520
float mPmlXAlpha
Perfectly matched layer attenuation in x.
Definition: Parameters.h:677
float getAbsorbTauScalar() const
Get absorb tau coefficient for homogeneous medium.
Definition: Parameters.h:350
size_t mNonLinearFlag
Is the wave propagation nonlinear?
Definition: Parameters.h:650
float mPmlYAlpha
Perfectly matched layer attenuation in y.
Definition: Parameters.h:679
bool mAlphaCoeffScalarFlag
Is alpha absorption coefficient homogeneous?
Definition: Parameters.h:653
std::string getGitHash() const
Get git hash of the code.
Definition: Parameters.cpp:471
size_t mTimeIndex
Actual time index (time step of the simulation).
Definition: Parameters.h:616
size_t mNonUniformGridFlag
Enable non uniform grid?
Definition: Parameters.h:646
size_t mPmlZSize
Depth of the perfectly matched layer in z.
Definition: Parameters.h:674
bool isCheckpointEnabled() const
Is checkpoint enabled?
Definition: Parameters.h:140
size_t mVelocityXSourceFlag
Velocity in x source flag.
Definition: Parameters.h:691
size_t getSensorMaskCornersSize() const
Get number of cuboids the sensor is composed of.
Definition: Parameters.h:494
float getPmlXAlpha() const
Get Perfectly matched layer attenuation in x, not implemented.
Definition: Parameters.h:389
bool getStoreVelocityMinFlag() const
Is –u_min set?
bool getCopySensorMaskFlag() const
Is –copy_mask set set?
size_t getProgressPrintInterval() const
Get progress print interval.
size_t mPressureSourceMany
Number of time series in the pressure source.
Definition: Parameters.h:707
bool getStorePressureRmsFlag() const
Is –p_rms set?
Definition: Parameters.h:510
size_t getPmlXSize() const
Get depth of the perfectly matched layer in x.
Definition: Parameters.h:373
bool getStorePressureRmsFlag() const
Is –p_rms set?
size_t getPmlZSize() const
Get depth of the perfectly matched layer in z.
Definition: Parameters.h:383
DimensionSizes getReducedDimensionSizes() const
Get reduced dimension sizes of the simulation (complex classes).
Definition: Parameters.h:197
float mC0Scalar
Scalar value of sound speed.
Definition: Parameters.h:632
bool getStorePressureRawFlag() const
Is –p_raw set?
size_t mVelocityYSourceFlag
Velocity in y source flag.
Definition: Parameters.h:693
Hdf5FileHeader mFileHeader
Handle to file header.
Definition: Parameters.h:606