kspaceFirstOrder3D-OMP  1.2
The C++ implementation of the k-wave toolbox for the time-domain simulation of acoustic wave fields in 3D
main.cpp
Go to the documentation of this file.
1 /**
2  * @file main.cpp
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 main file of kspaceFirstOrder3D-OMP.
10  *
11  * @version kspaceFirstOrder3D 2.16
12  *
13  * @date 11 July 2012, 10:57 (created) \n
14  * 04 September 2017, 14:15 (revised)
15  *
16  * @mainpage kspaceFirstOrder3D-OMP
17  *
18  * @section Overview 1 Overview
19  *
20  * k-Wave is an open source MATLAB toolbox designed for the time-domain simulation of propagating acoustic waves in 1D,
21  * 2D, or 3D. The toolbox has a wide range of functionality, but at its heart is an advanced numerical model that can
22  * account for both linear or nonlinear wave propagation, an arbitrary distribution of weakly heterogeneous material
23  * parameters, and power law acoustic absorption, see website [k-Wave](http://www.k-wave.org).
24  *
25  * This project is a part of the k-Wave toolbox accelerating 3D simulations using an optimized C++ implementation to
26  * run moderate to big grid sizes (64x64x64 to 512x512x512). Compiled binaries of the C++ code for x86 architectures
27  * are available from [k-Wave download site] (http://www.k-wave.org/download). Both 64-bit Linux (Ubuntu / Debian) and
28  * 64-bit Windows versions are provided. This Doxygen documentation was created based on the Linux version and provides
29  * details on the implementation of the CUDA/C++ code.
30  *
31  *
32  * @section Compilation 2 Compilation
33  *
34  *
35  * The source codes of <tt>kpsaceFirstOrder3D-OMP</tt> are written using the C++-11 standard and the OpenMP 4.0 library.
36  * There are variety of different C++ compilers that can be used to compile the source codes. We recommend using either
37  * the GNU C++ compiler (gcc/g++) version 5.0 and higher, or the Intel C++ compiler version 2015 and higher. Please note
38  * that Visual Studio compilers do not support OpenMP 4.0 standard and cannot be used thus. Be also aware of Intel
39  * compilers 2017 and their MKL bug producing incorrect results when AVX2 is enabled.
40  *
41  * The codes can be compiled on 64-bit Linux and Windows. 32-bit systems are not supported!
42  *
43  * This section describes the compilation procedure using GNU and Intel compilers on Linux. (The Windows users are
44  * encouraged to download the Visual Studio 2015 project and compile it using Intel Compiler from within Visual Studio.)
45  *
46  * Before compiling the code, it is necessary to install a C++ compiler and several libraries. The GNU compiler is
47  * usually part of Linux distributions and distributed as open source. It can be downloaded from [http://gcc.gnu.org/]
48  * (http://gcc.gnu.org/) if necessary.
49  * The Intel compiler can be downloaded from [http://software.intel.com/en-us/intel-composer-xe/]
50  * (http://software.intel.com/en-us/intel-composer-xe/). This package also includes the Intel MKL (Math Kernel Library)
51  * library that contains FFT. The Intel compiler is only free for non-commercial use.
52  *
53  * The code also relies on several libraries that are to be installed before compiling:
54  *
55  * \li HDF5 library - Mandatory I/O library, [version 1.8.x](https://support.hdfgroup.org/HDF5/release/obtain518.html).
56  * \li FFTW library - Optional library for FFT, [version 3.3.x](http://www.fftw.org/).
57  * \li MKL library - Optional library for FFT, [version 2015 or higher]
58  * (http://software.intel.com/en-us/intel-composer-xe/).
59  *
60  *
61  * Although it is possible to use any combination of the FFT library and the compiler, the best performance is observed
62  * when using GNU compiler and FFTW, or Intel Compiler and Intel MKL.
63 
64  * <b> 2.1 The HDF5 library installation procedure </b>
65 
66  * 1.Download the 64-bit HDF5 library [package for your platform]
67  * (https://support.hdfgroup.org/HDF5/release/obtain518.html). Please use version 1.8.x, the version 1.10.x
68  * is not compatible with MATLAB yet.
69  *
70  * 2. Configure the HDF5 distribution. Enable the high-level library and specify an installation folder by typing:
71  \verbatim
72  ./configure --enable-hl --prefix=folder_to_install
73 \endverbatim
74  * 3. Make the HDF5 library by typing:
75 \verbatim
76  make -j
77 \endverbatim
78  * 4. Install the HDF5 library by typing:
79 \verbatim
80  make install
81 \endverbatim
82  *
83  *
84  *
85  * <b> 2.2 The FFTW library installation procedure </b>
86  *
87  * 1. Download the FFTW library [package for your platform](http://www.fftw.org/download.html).
88  *
89  * 2. Configure the FFTW distribution. Enable OpenMP support, and desired SIMD instruction set, single precision
90  * floating point arithmetic, and specify an installation folder:
91 \verbatim
92  ./configure --enable-single --enable-sse --enable-openmp --enable-shared --prefix=folder_to_install
93 \endverbatim
94  * if you intend to use the FFTW library (and the C++ code) only on a selected machine and want to get the best
95  * possible performance, you may also add processor specific optimisations and AVX or AVX2 instructions set. Note,
96  * the compiled binary code is not likely to be portable on different CPUs. SSE2 version will work on any processor,
97  * AVX on Intel Sandy Bridge and newer, AVX2 on Intel Haswell and newer.
98 \verbatim
99  ./configure --enable-single --enable-avx --enable-openmp --enable-shared --with-gcc-arch=native \
100  --prefix=folder_to_install
101 \endverbatim
102  * More information about the installation and customization can be found at [here]
103  * (http://www.fftw.org/fftw3_doc/Installation-and-Customization.htm).
104  * For recent CPUs based on Sandy Bridge, Ivy Bridge, Haswell and Broadwell with
105  * strongly recommend to use the AVX and AVX2 support.
106  * 3. Make the FFTW library by typing:
107 \verbatim
108  make -j
109 \endverbatim
110  * 4. Install the FFTW library by typing:
111 \verbatim
112  make install
113 \endverbatim
114 
115  * <b> 2.3 The Intel Compiler and MKL installation procedure </b>
116  *
117  *
118  * 1. Download the Intel Composer XE package for [your platform]((http://software.intel.com/en-us/intel-compilers).
119  *
120  * 2. Run the installation script and follow the procedure by typing:
121 \verbatim
122  ./install.sh
123 \endverbatim
124  *
125  *
126  *
127  * <b> 2.4 Compiling the C++ code on Linux</b>
128  *
129  * After the libraries and the compiler have been installed, you are ready to compile the
130  * <tt>kspaceFirstOrder3D-OMP</tt> code.
131  *
132  *
133  * 1. Download the <tt>kspaceFirstOrder3D-OMP</tt> source codes.
134  *
135  * 2. Open the <tt>Makefile</tt> file. The Makefile supports code compilation under GNU compiler and FFTW, or Intel
136  * compiler with MKL. Uncomment the desired compiler by removing character `<tt>#</tt>'.
137 \verbatim
138  #COMPILER = GNU
139  #COMPILER = Intel
140 \endverbatim
141  *
142  * 3. Select how to link the libraries. Static linking is preferred as it may be a bit faster, however, on some systems (
143  * HPC clusters) it may be better to use dynamic linking and use the system specific libraries at runtime.
144 \verbatim
145  #LINKING = STATIC
146  #LINKING = DYNAMIC
147 \endverbatim
148  *
149  * 4. Select the instruction set and the CPU architecture.
150  * For users who will only use the binary on the same machine as compiled, the best choice is <tt>CPU_ARCH=native</tt>.
151  * If you are about to run the same binary on different machines or you want to cross-compile the code, you are free to
152  * use any of the possible choices, where SSE 3 is the most general but slowest and AVX2 is the most recent
153  * instruction set while believed to be the fastest one.
154 \verbatim
155  #CPU_ARCH = native
156  #CPU_ARCH = SSE3
157  #CPU_ARCH = SSE4
158  #CPU_ARCH = AVX
159  #CPU_ARCH = AVX2
160  \endverbatim
161  *
162  * 5. Set installation paths of the libraries (an example is shown bellow). Zlib and SZIP may be required if the
163  * compression is switched on.
164 \verbatim
165  MKL_DIR=
166  FFT_DIR=
167  HDF5_DIR=
168  ZLIB_DIR=
169  SZIP_DIR=
170 \endverbatim
171  *
172  *
173  * 6. Compile the source code by typing:
174 \verbatim
175  make -j
176 \endverbatim
177  If you want to clean the distribution, type:
178 \verbatim
179  make clean
180 \endverbatim
181  *
182  *
183  * @section Parameters 3 Command Line Parameters
184  *
185  * The C++ code requires two mandatory parameters and accepts a few optional parameters and flags. Ill parameters,
186  * bad simulation files, and runtime errors such as out-of-memory problems, lead to an exception followed by an error
187  * message shown and execution termination.
188  *
189  * The mandatory parameters <tt>-i</tt> and <tt>-o</tt> specify the input and output file. The file names respect the
190  * path conventions for particular operating system. If any of the files is not specified, cannot be found or created,
191  * an error message is shown and the code terminates.
192  *
193  * The <tt>-t</tt> parameter sets the number of threads used, which defaults the system maximum. If the system support
194  * hyperthreading, it is recommended to use only a half of the threads to prevent cache overloading. If possible enable
195  * tread binding and placement using export OMP_PROC_BIND=true.
196  *
197  *
198  * The <tt>-r</tt> parameter specifies how often information about the simulation progress is printed out to the command
199  * line. By default, the C++ code prints out the progress of the simulation, the elapsed time, and the estimated
200  * time of completion in intervals corresponding to 5% of the total number of times steps.
201  *
202  * The <tt>-c</tt> parameter specifies the compression level used by the ZIP library to reduce the size of the output
203  * file. The actual compression rate is highly dependent on the shape of the sensor mask and the range of stored
204  * quantities and may be computationally expensive. In general, the output data is very hard to compress, and using
205  * higher compression levels can greatly increase the time to save data while not having a large impact on the final
206  * file size. That's why we decided to disable compression in default settings.
207  *
208  * The <tt>\--benchmark</tt> parameter enables the total length of simulation (i.e., the number of time steps) to be
209  * overridden by setting a new number of time steps to simulate. This is particularly useful for performance evaluation
210  * and benchmarking. As the code performance is relatively stable, 50-100 time steps is usually enough to predict the
211  * simulation duration. This parameter can also be used to quickly check the simulation is set up correctly.
212  *
213  * The <tt>\--verbose</tt> parameter enables to select between three levels of verbosity. For routine simulations, the
214  * verbose level of 0 (the default one) is usually sufficient. For more information about the simulation, checking the
215  * parameters of the simulation, code version, GPU used, file paths, and debugging running scripts, verbose levels
216  * 1 and 2 may be very useful.
217  *
218  * The <tt>-h</tt> and <tt>\--help</tt> parameters print all the parameters of the C++ code. The <tt>\--version </tt>
219  * parameter reports detail information about the code useful for debugging and bug reports. It prints out the internal
220  * version, the build date and time, the git hash allowing us to track the version of the source code, the operating
221  * system, the compiler name and version and the instruction set used.
222  *
223  * For jobs that are expected to run for a very long time, it may be useful to checkpoint and restart the execution.
224  * One motivation is the wall clock limit per task on clusters where jobs must fit within a given time span (e.g. 24
225  * hours). The second motivation is a level of fault-tolerance, where you can back up the state of the simulation after
226  * a predefined period. To enable checkpoint-restart, the user is asked to specify a file to store the actual state of
227  * the simulation by <tt>\--checkpoint_file</tt> and the period in seconds after which the simulation will be
228  * interrupted by <tt>\--checkpoint_interval</tt>. When running on a cluster, please allocate enough time for the
229  * checkpoint procedure that can take a non-negligible amount of time (7 matrices have to be stored in the
230  * checkpoint file and all aggregated quantities are flushed into the output file). Please note, that the checkpoint
231  * file name and path is not checked at the beginning of the simulation, but at the time the code starts
232  * checkpointing. Thus make sure the file path was correctly specified (otherwise you will not find out the simulation
233  * crashed until the first leg of the simulation finishes). The rationale behind this is that to keep as high level of
234  * fault tolerance as possible, the checkpoint file should be touched even when really necessary.
235  *
236  * When controlling a multi-leg simulation by a script loop, the parameters of the code remains the same in all legs.
237  * The first leg of the simulation creates a checkpoint file while the last one deletes it. If the checkpoint file is
238  * not found the simulation starts from the beginning. In order to find out how many steps have been finished, please
239  * open the output file and read the variable <tt>t_index</tt> and compare it with <tt>Nt</tt> (e.g. by the h5dump
240  * command).
241  *
242  *
243  * The remaining flags specify the output quantities to be recorded during the simulation and stored on disk analogous
244  * to the sensor.record input. If the <tt>-p</tt> or <tt>\--p\_raw</tt> flags are set (these are equivalent), a time
245  * series of the acoustic pressure at the grid points specified by the sensor mask is recorded. If the
246  * <tt>\--p_rms</tt>, <tt>\--p_max</tt>, <tt>\--p_min</tt> flags are set, the root mean square and/or maximum and/or
247  * minimum values of the pressure at the grid points specified by the sensor mask are recorded. If the
248  * <tt>\--p_final</tt> flag is set, the values for the entire acoustic pressure field in the final time step of the
249  * simulation is stored (this will always include the PML, regardless of the setting for <tt> 'PMLInside'</tt>).
250  * The flags <tt>\--p_max_all</tt> and <tt>\--p_min_all</tt> allow to calculate the maximum and minimum values over the
251  * entire acoustic pressure field, regardless on the shape of the sensor mask. Flags to record the acoustic particle
252  * velocity are defined in an analogous fashion. For proper calculation of acoustic intensity, the particle velocity
253  * has to be shifted onto the same grid as the acoustic pressure. This can be done by setting
254  * <tt>\--u_non_staggered_raw</tt> flag, that first shifts the particle velocity and then samples the grid points
255  * specified by the sensor mask. Since the shift operation requires additional FFTs, the impact on the simulation time
256  * may be significant.
257  *
258  * Any combination of <tt>p</tt> and <tt>u</tt> flags is admissible. If no output flag is set, a time-series for the
259  * acoustic pressure is recorded. If it is not necessary to collect the output quantities over the entire simulation,
260  * the starting time step when the collection begins can be specified using the -s parameter. Note, the index for the
261  * first time step is 1 (this follows the MATLAB indexing convention).
262  *
263  * The <tt>\--copy_sensor_mask</tt> will copy the sensor from the input file to the output one at the end of the
264  * simulation. This helps in post-processing and visualisation of the outputs.
265  *
266 \verbatim
267 ┌───────────────────────────────────────────────────────────────┐
268 │ kspaceFirstOrder3D-OMP v1.2 │
269 ├───────────────────────────────────────────────────────────────┤
270 │ Usage │
271 ├───────────────────────────────────────────────────────────────┤
272 │ Mandatory parameters │
273 ├───────────────────────────────────────────────────────────────┤
274 │ -i <file_name> │ HDF5 input file │
275 │ -o <file_name> │ HDF5 output file │
276 ├───────────────────────────────┴───────────────────────────────┤
277 │ Optional parameters │
278 ├───────────────────────────────┬───────────────────────────────┤
279 │ -t <num_threads> │ Number of CPU threads │
280 │ │ (default = 4) │
281 │ -r <interval_in_%> │ Progress print interval │
282 │ │ (default = 5%) │
283 │ -c <compression_level> │ Compression level <0,9> │
284 │ │ (default = 0) │
285 │ --benchmark <time_steps> │ Run only a specified number │
286 │ │ of time steps │
287 │ --verbose <level> │ Level of verbosity <0,2> │
288 │ │ 0 - basic, 1 - advanced, │
289 │ │ 2 - full │
290 │ │ (default = basic) │
291 │ -h, --help │ Print help │
292 │ --version │ Print version and build info │
293 ├───────────────────────────────┼───────────────────────────────┤
294 │ --checkpoint_file <file_name> │ HDF5 Checkpoint file │
295 │ --checkpoint_interval <sec> │ Checkpoint after a given │
296 │ │ number of seconds │
297 ├───────────────────────────────┴───────────────────────────────┤
298 │ Output flags │
299 ├───────────────────────────────┬───────────────────────────────┤
300 │ -p │ Store acoustic pressure │
301 │ │ (default output flag) │
302 │ │ (the same as --p_raw) │
303 │ --p_raw │ Store raw time series of p │
304 │ --p_rms │ Store rms of p │
305 │ --p_max │ Store max of p │
306 │ --p_min │ Store min of p │
307 │ --p_max_all │ Store max of p (whole domain) │
308 │ --p_min_all │ Store min of p (whole domain) │
309 │ --p_final │ Store final pressure field │
310 ├───────────────────────────────┼───────────────────────────────┤
311 │ -u │ Store ux, uy, uz │
312 │ │ (the same as --u_raw) │
313 │ --u_raw │ Store raw time series of │
314 │ │ ux, uy, uz │
315 │ --u_non_staggered_raw │ Store non-staggered raw time │
316 │ │ series of ux, uy, uz │
317 │ --u_rms │ Store rms of ux, uy, uz │
318 │ --u_max │ Store max of ux, uy, uz │
319 │ --u_min │ Store min of ux, uy, uz │
320 │ --u_max_all │ Store max of ux, uy, uz │
321 │ │ (whole domain) │
322 │ --u_min_all │ Store min of ux, uy, uz │
323 │ │ (whole domain) │
324 │ --u_final │ Store final acoustic velocity │
325 ├───────────────────────────────┼───────────────────────────────┤
326 │ -s <time_step> │ When data collection begins │
327 │ │ (default = 1) │
328 └───────────────────────────────┴───────────────────────────────┘
329 \endverbatim
330  *
331  *
332  *
333  * @section HDF5Files 4 HDF5 File Structure
334  * The C++ code has been designed as a standalone application which is not dependent on MATLAB libraries or a MEX
335  * interface. This is of particular importance when using servers and supercomputers without MATLAB support. For this
336  * reason, simulation data must be transferred between the C++ code and MATLAB using external input and output
337  * files. These files are stored using the [Hierarchical Data Format HDF5] (http://www.hdfgroup.org/HDF5/). This is a
338  * data model, library, and file format for storing and managing data. It supports a variety of datatypes, and is
339  * designed for flexible and efficient I/O and for high volume and complex data. The HDF5 technology suite includes
340  * tools and applications for managing, manipulating, viewing, and analysing data in the HDF5 format.
341  *
342  *
343  * Each HDF5 file is a container for storing a variety of scientific data and is composed of two primary types of
344  * objects: groups and datasets. An HDF5 group is a structure containing zero or more HDF5 objects, together with
345  * supporting metadata. A HDF5 group can be seen as a disk folder. An HDF5 dataset is a multidimensional array of data
346  * elements, together with supporting metadata. A HDF5 dataset can be seen as a disk file. Any HDF5 group or dataset
347  * may also have an associated attribute list. An HDF5 attribute is a user-defined HDF5 structure that provides extra
348  * information about an HDF5 object. More information can be obtained from the [HDF5 documentation]
349  * (http://www.hdfgroup.org/HDF5/doc/index.html).
350  *
351  *
352  * kspaceFirstOrder3D-OMP v1.2 uses the file format introduced in version 1.1. The code is happy to work with both
353  * versions (1.0 and 1.1), however when working with an input file of version 1.0, some features are not supported,
354  * namely the cuboid sensor mask, and <tt>u_non_staggered_raw</tt>. When running from within the actual MATLAB K-Wave
355  * Toolbox, the files will always be generated in version 1.1.
356  *
357  * The HDF5 input file for the C++ simulation code contains a file header with brief description of the simulation
358  * stored in string attributes, and the root group <tt>'/'</tt> which stores all the simulation properties in the form
359  * of 3D datasets (a complete list of input datasets is given bellow).
360  * The HDF5 checkpoint file contains the same file header as the input file and the root group <tt>'/'</tt> with a few
361  * datasets keeping the actual simulation state. The HDF5 output file contains a file header with the simulation
362  * description as well as performance statistics, such as the simulation time and memory consumption, stored in string
363  * attributes.
364 
365  * The results of the simulation are stored in the root group <tt>'/'</tt> in the form of 3D datasets. If the linear
366  * sensor mask is used, all output quantities are stored as datasets in the root group. If the cuboid corners sensor
367  * mask is used, the sampled quantities form private groups containing datasets on per cuboid basis.
368  *
369  *\verbatim
370 +----------------------------------------------------------------------------------------------------------------------+
371 | Input File / Checkpoint File Header |
372 +----------------------------------------------------------------------------------------------------------------------+
373 | created_by Short description of the tool that created this file |
374 | creation_date Date when the file was created |
375 | file_description Short description of the content of the file (e.g. simulation name) |
376 | file_type Type of the file (input) |
377 | major_version Major version of the file definition (1) |
378 | minor_version Minor version of the file definition (1) |
379 +----------------------------------------------------------------------------------------------------------------------+
380  \endverbatim
381  *
382  * \verbatim
383 +----------------------------------------------------------------------------------------------------------------------+
384 | Output File Header |
385 +----------------------------------------------------------------------------------------------------------------------+
386 | created_by Short description of the tool that created this file |
387 | creation_date Date when the file was created |
388 | file_description Short description of the content of the file (e.g. simulation name) |
389 | file_type Type of the file (output) |
390 | major_version Major version of the file definition (1) |
391 | minor_version Minor version of the file definition (1) |
392 +----------------------------------------------------------------------------------------------------------------------+
393 | host_names List of hosts (computer names) the simulation was executed on |
394 | number_of_cpu_cores Number of CPU cores used for the simulation |
395 | data_loading_phase_execution_time Time taken to load data from the file |
396 | pre-processing_phase_execution_time Time taken to pre-process data |
397 | simulation_phase_execution_time Time taken to run the simulation |
398 | post-processing_phase_execution_time Time taken to complete the post-processing phase |
399 | total_execution_time Total execution time |
400 | peak_core_memory_in_use Peak memory required per core during the simulation |
401 | total_memory_in_use Total Peak memory in use |
402 +----------------------------------------------------------------------------------------------------------------------+
403 \endverbatim
404  *
405  *
406  *
407  * The input and checkpoint file stores all quantities as three dimensional datasets with dimension sizes designed by
408  * <tt>(Nx, Ny, Nz)</tt>. In order to support scalars and 1D and 2D arrays, the unused dimensions are set to 1. For
409  * example, scalar variables are stored with a dimension size of <tt>(1,1,1)</tt>, 1D vectors oriented in y-direction
410  * are stored with a dimension size of <tt>(1, Ny, 1)</tt>, and so on. If the dataset stores a complex variable, the
411  * real and imaginary parts are stored in an interleaved layout and the lowest used dimension size is doubled (i.e.,
412  * Nx for a 3D matrix, Ny for a 1D vector oriented in the y-direction). The datasets are physically stored in row-major
413  * order (in contrast to column-major order used by MATLAB) using either the <tt>'H5T_IEEE_F32LE'</tt> data type for
414  * floating point datasets or <tt>'H5T_STD_U64LE'</tt> for integer based datasets. All the datasets are store under the
415  * root group.
416  *
417  *
418  * The output file of version 1.0 could only store recorded quantities as 3D datasets under the root group. However,
419  * with version 1.1 and the new cuboid corner sensor mask, the sampled quantities may be laid out as 4D quantities
420  * stored under specific groups. The dimensions are always <tt>(Nx, Ny, Nz, Nt)</tt>, every sampled cuboid is stored as
421  * a distinct dataset and the datasets are grouped under a group named by the quantity stored. This makes the file
422  * clearly readable and easy to parse.
423  *
424  *
425  * In order to enable compression and more efficient data processing, big datasets are not stored as monolithic blocks
426  * but broken into chunks that may be compressed by the ZIP library and stored separately. The chunk size is defined
427  * as follows:
428  *
429  * \li <tt> (1M elements, 1, 1) </tt> in the case of 1D variables - index sensor mask (8MB blocks).
430  * \li <tt> (Nx, Ny, 1) </tt> in the case of 3D variables (one 2D slab).
431  * \li <tt> (Nx, Ny, Nz, 1) </tt> in the case of 4D variables (one time step).
432  * \li <tt> (N_sensor_points, 1, 1) </tt> in the case of the output time series (one time step of
433  * the simulation).
434  *
435  *
436  * All datasets have two attributes that specify the content of the dataset. The <tt>'data_type'</tt> attribute
437  * specifies the data type of the dataset. The admissible values are either <tt>'float'</tt> or <tt>'long'</tt>. The
438  * <tt>'domain_type'</tt> attribute specifies the domain of the dataset. The admissible values are either <tt>'real'
439  * </tt> for the real domain or \c 'complex' for the complex domain. The C++ code reads these attributes and checks
440  * their values.
441  *
442  *
443  *
444  * \verbatim
445 +----------------------------------------------------------------------------------------------------------------------+
446 | Input File Datasets |
447 +----------------------------------------------------------------------------------------------------------------------+
448 | Name Size Data type Domain Type Condition of Presence |
449 +----------------------------------------------------------------------------------------------------------------------+
450 | 1. Simulation Flags |
451 +----------------------------------------------------------------------------------------------------------------------+
452 | ux_source_flag (1, 1, 1) long real |
453 | uy_source_flag (1, 1, 1) long real |
454 | uz_source_flag (1, 1, 1) long real |
455 | p_source_flag (1, 1, 1) long real |
456 | p0_source_flag (1, 1, 1) long real |
457 | transducer_source_flag (1, 1, 1) long real |
458 | nonuniform_grid_flag (1, 1, 1) long real must be set to 0 |
459 | nonlinear_flag (1, 1, 1) long real |
460 | absorbing_flag (1, 1, 1) long real |
461 +----------------------------------------------------------------------------------------------------------------------+
462  2. Grid Properties |
463 +----------------------------------------------------------------------------------------------------------------------+
464 | Nx (1, 1, 1) long real |
465 | Ny (1, 1, 1) long real |
466 | Nz (1, 1, 1) long real |
467 | Nt (1, 1, 1) long real |
468 | dt (1, 1, 1) float real |
469 | dx (1, 1, 1) float real |
470 | dy (1, 1, 1) float real |
471 | dz (1, 1, 1) float real |
472 +----------------------------------------------------------------------------------------------------------------------+
473 | 3. Medium Properties |
474 +----------------------------------------------------------------------------------------------------------------------+
475 | 3.1 Regular Medium Properties |
476 | rho0 (Nx, Ny, Nz) float real heterogenous |
477 | (1, 1, 1) float real homogenous |
478 | rho0_sgx (Nx, Ny, Nz) float real heterogenous |
479 | (1, 1, 1) float real homogenous |
480 | rho0_sgy (Nx, Ny, Nz) float real heterogenous |
481 | (1, 1, 1) float real homogenous |
482 | rho0_sgz (Nx, Ny, Nz) float real heterogenous |
483 | (1, 1, 1) float real homogenous |
484 | c0 (Nx, Ny, Nz) float real heterogenous |
485 | (1, 1, 1) float real homogenous |
486 | c_ref (1, 1, 1) float real |
487 | |
488 | 3.2 Nonlinear Medium Properties (defined if (nonlinear_flag == 1)) |
489 | BonA (Nx, Ny, Nz) float real heterogenous |
490 | (1, 1, 1) float real homogenous |
491 | |
492 | 3.3 Absorbing Medium Properties (defined if (absorbing_flag == 1)) |
493 | alpha_coef (Nx, Ny, Nz) float real heterogenous |
494 | (1, 1, 1) float real homogenous |
495 | alpha_power (1, 1, 1) float real |
496 +----------------------------------------------------------------------------------------------------------------------+
497 | 4. Sensor Variables |
498 +----------------------------------------------------------------------------------------------------------------------+
499 | sensor_mask_type (1, 1, 1) long real file version 1.1 |
500 | (0 = index, 1 = corners) |
501 | sensor_mask_index (Nsens, 1, 1) long real file version 1.0 always, |
502 | file version 1.1 and sensor_mask_type == 0 |
503 | sensor_mask_corners (Ncubes, 6, 1) long real file version 1.1 and sensor_mask_type == 1 |
504 +----------------------------------------------------------------------------------------------------------------------+
505 | 5 Source Properties |
506 +----------------------------------------------------------------------------------------------------------------------+
507 | 5.1 Velocity Source Terms (defined if (ux_source_flag == 1 || uy_source_flag == 1 || uz_source_flag == 1)) |
508 | u_source_mode (1, 1, 1) long real |
509 | u_source_many (1, 1, 1) long real |
510 | u_source_index (Nsrc, 1, 1) long real |
511 | ux_source_input (1, Nt_src, 1) float real u_source_many == 0 |
512 | (Nsrc, Nt_src, 1) float real u_source_many == 1 |
513 | uy_source_input (1, Nt_src, 1) float real u_source_many == 0 |
514 | (Nsrc, Nt_src, 1) float real u_source_many == 1 |
515 | uz_source_input (1, Nt_src, 1) float real u_source_many == 0 |
516 | (Nt_src, Nsrc, 1) float real u_source_many == 1 |
517 | |
518 | 5.2 Pressure Source Terms (defined if (p_source_flag == 1)) |
519 | p_source_mode (1, 1, 1) long real |
520 | p_source_many (1, 1, 1) long real |
521 | p_source_index (Nsrc, 1, 1) long real |
522 | p_source_input (Nsrc, Nt_src, 1) float real p_source_many == 1 |
523 | (1, Nt_src, 1) float real p_source_many == 0 |
524 | |
525 | 5.3 Transducer Source Terms (defined if (transducer_source_flag == 1)) |
526 | u_source_index (Nsrc, 1, 1) long real |
527 | transducer_source_input (Nt_src, 1, 1) float real |
528 | delay_mask (Nsrc, 1, 1) float real |
529 | |
530 | 5.4 IVP Source Terms (defined if ( p0_source_flag == 1)) |
531 | p0_source_input (Nx, Ny, Nz) float real |
532 +----------------------------------------------------------------------------------------------------------------------+
533 | 6. K-space and Shift Variables |
534 +----------------------------------------------------------------------------------------------------------------------+
535 | ddx_k_shift_pos_r (Nx/2 + 1, 1, 1) float complex |
536 | ddx_k_shift_neg_r (Nx/2 + 1, 1, 1) float complex |
537 | ddy_k_shift_pos (1, Ny, 1) float complex |
538 | ddy_k_shift_neg (1, Ny, 1) float complex |
539 | ddz_k_shift_pos (1, 1, Nz) float complex |
540 | ddz_k_shift_neg (1, 1, Nz) float complex |
541 | x_shift_neg_r (Nx/2 + 1, 1, 1) float complex file version 1.1 |
542 | y_shift_neg_r (1, Ny/2 + 1, 1) float complex file version 1.1 |
543 | z_shift_neg_r (1, 1, Nz/2) float complex file version 1.1 |
544 +----------------------------------------------------------------------------------------------------------------------+
545 | 7. PML Variables |
546 +----------------------------------------------------------------------------------------------------------------------+
547 | pml_x_size (1, 1, 1) long real |
548 | pml_y_size (1, 1, 1) long real |
549 | pml_z_size (1, 1, 1) long real |
550 | pml_x_alpha (1, 1, 1) float real |
551 | pml_y_alpha (1, 1, 1) float real |
552 | pml_z_alpha (1, 1, 1) float real |
553 | |
554 | pml_x (Nx, 1, 1) float real |
555 | pml_x_sgx (Nx, 1, 1) float real |
556 | pml_y (1, Ny, 1) float real |
557 | pml_y_sgy (1, Ny, 1) float real |
558 | pml_z (1, 1, Nz) float real |
559 | pml_z_sgz (1, 1, Nz) float real |
560 +----------------------------------------------------------------------------------------------------------------------+
561  \endverbatim
562 
563 \verbatim
564 +----------------------------------------------------------------------------------------------------------------------+
565 | Checkpoint File Datasets |
566 +----------------------------------------------------------------------------------------------------------------------+
567 | Name Size Data type Domain Type Condition of Presence |
568 +----------------------------------------------------------------------------------------------------------------------+
569 | 1. Grid Properties |
570 +----------------------------------------------------------------------------------------------------------------------+
571 | Nx (1, 1, 1) long real |
572 | Ny (1, 1, 1) long real |
573 | Nz (1, 1, 1) long real |
574 | Nt (1, 1, 1) long real |
575 | t_index (1, 1, 1) long real |
576 +----------------------------------------------------------------------------------------------------------------------+
577 | 2. Simulation State |
578 +----------------------------------------------------------------------------------------------------------------------+
579 | p (Nx, Ny, Nz) float real |
580 | ux_sgx (Nx, Ny, Nz) float real |
581 | uy_sgy (Nx, Ny, Nz) float real |
582 | uz_sgz (Nx, Ny, Nz) float real |
583 | rhox (Nx, Ny, Nz) float real |
584 | rhoy (Nx, Ny, Nz) float real |
585 | rhoz (Nx, Ny, Nz) float real |
586 +----------------------------------------------------------------------------------------------------------------------+
587 \endverbatim
588 
589 
590  \verbatim
591 +----------------------------------------------------------------------------------------------------------------------+
592 | Output File Datasets |
593 +----------------------------------------------------------------------------------------------------------------------+
594 | Name Size Data type Domain Type Condition of Presence |
595 +----------------------------------------------------------------------------------------------------------------------+
596 | 1. Simulation Flags |
597 +----------------------------------------------------------------------------------------------------------------------+
598 | ux_source_flag (1, 1, 1) long real |
599 | uy_source_flag (1, 1, 1) long real |
600 | uz_source_flag (1, 1, 1) long real |
601 | p_source_flag (1, 1, 1) long real |
602 | p0_source_flag (1, 1, 1) long real |
603 | transducer_source_flag (1, 1, 1) long real |
604 | nonuniform_grid_flag (1, 1, 1) long real |
605 | nonlinear_flag (1, 1, 1) long real |
606 | absorbing_flag (1, 1, 1) long real |
607 | u_source_mode (1, 1, 1) long real if u_source |
608 | u_source_many (1, 1, 1) long real if u_source |
609 | p_source_mode (1, 1, 1) long real if p_source |
610 | p_source_many (1, 1, 1) long real if p_source |
611 +----------------------------------------------------------------------------------------------------------------------+
612 | 2. Grid Properties |
613 +----------------------------------------------------------------------------------------------------------------------+
614 | Nx (1, 1, 1) long real |
615 | Ny (1, 1, 1) long real |
616 | Nz (1, 1, 1) long real |
617 | Nt (1, 1, 1) long real |
618 | dt (1, 1, 1) float real |
619 | dx (1, 1, 1) float real |
620 | dy (1, 1, 1) float real |
621 | dz (1, 1, 1) float real |
622 +----------------------------------------------------------------------------------------------------------------------+
623 | 3. PML Variables |
624 +----------------------------------------------------------------------------------------------------------------------+
625 | pml_x_size (1, 1, 1) long real |
626 | pml_y_size (1, 1, 1) long real |
627 | pml_z_size (1, 1, 1) long real |
628 | pml_x_alpha (1, 1, 1) float real |
629 | pml_y_alpha (1, 1, 1) float real |
630 | pml_z_alpha (1, 1, 1) float real |
631 | |
632 | pml_x (Nx, 1, 1) float real |
633 | pml_x_sgx (Nx, 1, 1) float real |
634 | pml_y (1, Ny, 1) float real |
635 | pml_y_sgy (1, Ny, 1) float real |
636 | pml_z (1, 1, Nz) float real |
637 | pml_z_sgz (1, 1, Nz) float real |
638 +----------------------------------------------------------------------------------------------------------------------+
639 | 4. Sensor Variables (present if --copy_sensor_mask) |
640 +----------------------------------------------------------------------------------------------------------------------+
641 | sensor_mask_type (1, 1, 1) long real file version 1.1 and --copy_sensor_mask |
642 | sensor_mask_index (Nsens, 1, 1) long real file version 1.1 and sensor_mask_type == 0 |
643 | sensor_mask_corners (Ncubes, 6, 1) long real file version 1.1 and sensor_mask_type == 1 |
644 +----------------------------------------------------------------------------------------------------------------------+
645 | 5a. Simulation Results: if sensor_mask_type == 0 (index), or File version == 1.0 |
646 +----------------------------------------------------------------------------------------------------------------------+
647 | p (Nsens, Nt - s, 1) float real -p or --p_raw |
648 | p_rms (Nsens, 1, 1) float real --p_rms |
649 | p_max (Nsens, 1, 1) float real --p_max |
650 | p_min (Nsens, 1, 1) float real --p_min |
651 | p_max_all (Nx, Ny, Nz) float real --p_max_all |
652 | p_min_all (Nx, Ny, Nz) float real --p_min_all |
653 | p_final (Nx, Ny, Nz) float real --p_final |
654 | |
655 | ux (Nsens, Nt - s, 1) float real -u or --u_raw |
656 | uy (Nsens, Nt - s, 1) float real -u or --u_raw |
657 | uz (Nsens, Nt - s, 1) float real -u or --u_raw |
658 | |
659 | ux_non_staggered (Nsens, Nt - s, 1) float real --u_non_staggered_raw (File version ==1.1) |
660 | uy_non_staggered (Nsens, Nt - s, 1) float real --u_non_staggered_raw (File version ==1.1) |
661 | uz_non_staggered (Nsens, Nt - s, 1) float real --u_non_staggered_raw (File version ==1.1) |
662 | |
663 | ux_rms (Nsens, 1, 1) float real --u_rms |
664 | uy_rms (Nsens, 1, 1) float real --u_rms |
665 | uz_rms (Nsens, 1, 1) float real --u_rms |
666 | |
667 | ux_max (Nsens, 1, 1) float real --u_max |
668 | uy_max (Nsens, 1, 1) float real --u_max |
669 | uz_max (Nsens, 1, 1) float real --u_max |
670 | |
671 | ux_min (Nsens, 1, 1) float real --u_min |
672 | uy_min (Nsens, 1, 1) float real --u_min |
673 | uz_min (Nsens, 1, 1) float real --u_min |
674 | |
675 | ux_max_all (Nx, Ny, Nz) float real --u_max_all |
676 | uy_max_all (Nx, Ny, Nz) float real --u_max_all |
677 | uz_max_all (Nx, Ny, Nz) float real --u_max_all |
678 | |
679 | ux_min_all (Nx, Ny, Nz) float real --u_min_all |
680 | uy_min_all (Nx, Ny, Nz) float real --u_min_all |
681 | uz_min_all (Nx, Ny, Nz) float real --u_min_all |
682 | |
683 | ux_final (Nx, Ny, Nz) float real --u_final |
684 | uy_final (Nx, Ny, Nz) float real --u_final |
685 | uz_final (Nx, Ny, Nz) float real --u_final |
686 +----------------------------------------------------------------------------------------------------------------------+
687 | 5b. Simulation Results: if sensor_mask_type == 1 (corners) and file version == 1.1 |
688 +----------------------------------------------------------------------------------------------------------------------+
689 | /p group of datasets, one per cuboid -p or --p_raw |
690 | /p/1 (Cx, Cy, Cz, Nt-s) float real 1st sampled cuboid |
691 | /p/2 (Cx, Cy, Cz, Nt-s) float real 2nd sampled cuboid, etc. |
692 | |
693 | /p_rms group of datasets, one per cuboid --p_rms |
694 | /p_rms/1 (Cx, Cy, Cz, Nt-s) float real 1st sampled cuboid |
695 | |
696 | /p_max group of datasets, one per cuboid --p_max |
697 | /p_max/1 (Cx, Cy, Cz, Nt-s) float real 1st sampled cuboid |
698 | |
699 | /p_min group of datasets, one per cuboid --p_min |
700 | /p_min/1 (Cx, Cy, Cz, Nt-s) float real 1st sampled cuboid |
701 | |
702 | p_max_all (Nx, Ny, Nz) float real --p_max_all |
703 | p_min_all (Nx, Ny, Nz) float real --p_min_all |
704 | p_final (Nx, Ny, Nz) float real --p_final |
705 | |
706 | |
707 | /ux group of datasets, one per cuboid -u or --u_raw |
708 | /ux/1 (Cx, Cy, Cz, Nt-s) float real 1st sampled cuboid |
709 | /uy group of datasets, one per cuboid -u or --u_raw |
710 | /uy/1 (Cx, Cy, Cz, Nt-s) float real 1st sampled cuboid |
711 | /uz group of datasets, one per cuboid -u or --u_raw |
712 | /uz/1 (Cx, Cy, Cz, Nt-s) float real 1st sampled cuboid |
713 | |
714 | /ux_non_staggered group of datasets, one per cuboid --u_non_staggered_raw |
715 | /ux_non_staggered/1 (Cx, Cy, Cz, Nt-s) float real 1st sampled cuboid |
716 | /uy_non_staggered group of datasets, one per cuboid --u_non_staggered_raw |
717 | /uy_non_staggered/1 (Cx, Cy, Cz, Nt-s) float real 1st sampled cuboid |
718 | /uz_non_staggered group of datasets, one per cuboid --u_non_staggered_raw |
719 | /uz_non_staggered/1 (Cx, Cy, Cz, Nt-s) float real 1st sampled cuboid |
720 | |
721 | /ux_rms group of datasets, one per cuboid --u_rms |
722 | /ux_rms/1 (Cx, Cy, Cz, Nt-s) float real 1st sampled cuboid |
723 | /uy_rms group of datasets, one per cuboid --u_rms |
724 | /uy_rms/1 (Cx, Cy, Cz, Nt-s) float real 1st sampled cuboid |
725 | /uz_rms group of datasets, one per cuboid --u_rms |
726 | /uy_rms/1 (Cx, Cy, Cz, Nt-s) float real 1st sampled cuboid |
727 | |
728 | /ux_max group of datasets, one per cuboid --u_max |
729 | /ux_max/1 (Cx, Cy, Cz, Nt-s) float real 1st sampled cuboid |
730 | /uy_max group of datasets, one per cuboid --u_max |
731 | /ux_max/1 (Cx, Cy, Cz, Nt-s) float real 1st sampled cuboid |
732 | /uz_max group of datasets, one per cuboid --u_max |
733 | /ux_max/1 (Cx, Cy, Cz, Nt-s) float real 1st sampled cuboid |
734 | |
735 | /ux_min group of datasets, one per cuboid --u_min |
736 | /ux_min/1 (Cx, Cy, Cz, Nt-s) float real 1st sampled cuboid |
737 | /uy_min group of datasets, one per cuboid --u_min |
738 | /ux_min/1 (Cx, Cy, Cz, Nt-s) float real 1st sampled cuboid |
739 | /uz_min group of datasets, one per cuboid --u_min |
740 | /ux_min/1 (Cx, Cy, Cz, Nt-s) float real 1st sampled cuboid |
741 | |
742 | ux_max_all (Nx, Ny, Nz) float real --u_max_all |
743 | uy_max_all (Nx, Ny, Nz) float real --u_max_all |
744 | uz_max_all (Nx, Ny, Nz) float real --u_max_all |
745 | |
746 | ux_min_all (Nx, Ny, Nz) float real --u_min_all |
747 | uy_min_all (Nx, Ny, Nz) float real --u_min_all |
748 | uz_min_all (Nx, Ny, Nz) float real --u_min_all |
749 | |
750 | ux_final (Nx, Ny, Nz) float real --u_final |
751 | uy_final (Nx, Ny, Nz) float real --u_final |
752 | uz_final (Nx, Ny, Nz) float real --u_final |
753 +----------------------------------------------------------------------------------------------------------------------+
754 \endverbatim
755  *
756  *
757  * @copyright Copyright (C) 2017 Jiri Jaros and Bradley Treeby.
758  *
759  * This file is part of the C++ extension of the [k-Wave Toolbox](http://www.k-wave.org).
760  *
761  * This file is part of the k-Wave. k-Wave is free software: you can redistribute it and/or modify it under the terms
762  * of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the
763  * License, or (at your option) any later version.
764  *
765  * k-Wave is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
766  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
767  * more details.
768  *
769  * You should have received a copy of the GNU Lesser General Public License along with k-Wave.
770  * If not, see [http://www.gnu.org/licenses/](http://www.gnu.org/licenses/).
771  */
772 
773 
774 #include <iostream>
775 #include <exception>
776 
777 #ifdef _OPENMP
778  #include <omp.h>
779 #endif
780 
782 #include <Logger/Logger.h>
783 
784 
785 using std::ios;
786 using std::string;
787 
788 
789 /**
790  * The main function of the ksppaceFirstOrder3D-OMP.
791  *
792  * @param [in] argc
793  * @param [in] argv
794  * @return EXIT_SUCCESS - If the simulation completed correctly.
795  *
796  */
797 int main(int argc, char** argv)
798 {
799  // Create K-Space solver
800  KSpaceFirstOrder3DSolver kSpaceSolver;
801 
802  // print header
806 
807 
808  // Create parameters and parse command line
809  Parameters& parameters = Parameters::getInstance();
810 
811  //------------------------------------- Init simulation ---------------------------------------//
812  try
813  {
814  parameters.init(argc,argv);
815 
816  if (parameters.isPrintVersionOnly())
817  {
818  kSpaceSolver.printFullCodeNameAndLicense();
819  return EXIT_SUCCESS;
820  }
821  }
822  catch (const std::exception &e)
823  {
827  }
828 
829  // set number of threads and bind them to cores
830  #ifdef _OPENMP
831  // Affinity was disabled as it may interfere with batch schedulers on some clusters. The user is resposible to
832  // set it properly
833  //kSpaceSolver.setProcessorAffinity();
834  omp_set_num_threads(parameters.getNumberOfThreads());
835  #endif
836 
837  // Print simulation setup
838  parameters.printSimulatoinSetup();
839 
841 
842  //-------------------------------------- Allocate memory --------------------------------------//
843  try
844  {
845  kSpaceSolver.allocateMemory();
846  }
847  catch (const std::bad_alloc& e)
848  {
851  // 9 = Indentation of Error:
853  }
854  catch (const std::exception& e)
855  {
858 
859  const string errorMessage = string(kErrFmtUnknownError) + e.what();
861  };
862 
863 
864  //-------------------------------------- Load input data --------------------------------------//
865  try
866  {
867  kSpaceSolver.loadInputData();
868  }
869  catch (const std::ios::failure& e)
870  {
873  // 9 = Indentation of Error:
875  }
876  catch (const std::exception& e)
877  {
880 
881  const string errorMessage = string(kErrFmtUnknownError) + e.what();
883  }
884 
886 
887  // did we recover from checkpoint?
888  if (parameters.getTimeIndex() > 0)
889  {
892  }
893 
894 
895  //----------------------------------------- Simulation ----------------------------------------//
897  // exception are caught inside due to different log formats
898  kSpaceSolver.compute();
899 
900  //------------------------------------------- Summary -----------------------------------------//
903 
905 
906  if (kSpaceSolver.getCumulatedTotalTime() != kSpaceSolver.getTotalTime())
907  {
909  }
911 
913 
914  return EXIT_SUCCESS;
915 }// end of main
916 //----------------------------------------------------------------------------------------------------------------------
double getDataLoadTime() const
Get data load time.
OutputMessage kOutFmtLegExecutionTime
Output message.
ErrorMessage kErrFmtPathDelimiters
delimiters for linux paths
Definition: ErrorMessages.h:53
OutputMessage kOutFmtFailed
Output message - failed message.
static void log(const LogLevel queryLevel, const std::string &format, Args ... args)
Log desired activity for a given log level, version with string format.
Definition: Logger.h:97
OutputMessage kOutFmtElapsedTime
Output message.
int main(int argc, char **argv)
Definition: main.cpp:797
OutputMessage kOutFmtRecoveredFrom
Output message.
static std::string wordWrapString(const std::string &inputString, const std::string &delimiters, const int indentation=0, const int lineSize=65)
Definition: Logger.cpp:111
double getTotalTime() const
Get total simulation time.
virtual void loadInputData()
Load simulation data.
Class storing all parameters of the simulation.
Definition: Parameters.h:50
void printSimulatoinSetup()
Print the simulation setup (all parameters).
Definition: Parameters.cpp:137
OutputMessage kOutFmtSummaryHeader
Output message.
virtual void compute()
This method computes k-space First Order 3D simulation.
OutputMessage kOutFmtFirstSeparator
Output message - first separator.
std::string getCodeName() const
Get code name - release code version.
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
OutputMessage kOutFmtInitializationHeader
Output message.
The header file containing the main class of the project responsible for the entire simulation...
OutputMessage kOutFmtMemoryUsage
Output message.
double getCumulatedTotalTime() const
Get total simulation time accumulated over all legs.
static void errorAndTerminate(const std::string &errorMessage)
Log an error and terminate the execution.
Definition: Logger.cpp:84
ErrorMessage kErrFmtUnknownError
Unknown error - unknown error.
Definition: ErrorMessages.h:59
The header file containing a class responsible for printing out info and error messages (stdout...
OutputMessage kOutFmtTotalExecutionTime
Output message.
Class responsible for running the k-space first order 3D method.
size_t getTimeIndex() const
Get actual simulation time step.
Definition: Parameters.h:208
virtual size_t getMemoryUsage() const
Get memory usage in MB on the host side.
virtual void allocateMemory()
Memory allocation.
Basic (default) level of verbosity.
void printFullCodeNameAndLicense() const
Print the code name and license.
OutputMessage kOutFmtLastSeparator
Output message -last separator.
void init(int argc, char **argv)
Parse command line and read scalar values form the input file.
Definition: Parameters.cpp:102
OutputMessage kOutFmtCodeName
Output message.
OutputMessage kOutFmtEndOfSimulation
Output message.
OutputMessage kOutFmtSeparator
Output message - separator.
static Parameters & getInstance()
Get instance of the singleton class.
Definition: Parameters.cpp:84
ErrorMessage kErrFmtOutOfMemory
error message - out of memory
Definition: ErrorMessages.h:56