next up previous [pdf]

Next: Fortran 90 program Up: Sava: RSF DEMO Previous: C program

C++ program

  1. Declare input, output and auxiliary file cubes (of type CUB).

  2. Declare, read and write RSF cube axes: at time axis, ax space axis, az depth axis.

  3. Declare multi-dimensional valarrays for input, output and read data.

  4. Declare multi-dimensional valarrays for temporary storage.

  5. Initialize multidimensional valarray index counter (of type VAI).

  6. Loop over time.

  7. Compute Laplacian: $\Delta U$.

  8. Inject source wavelet: $\left[ \Delta U - f(t) \right]$

  9. Scale by velocity: $\left[ \Delta U - f(t) \right] v^2$

  10. Time step: $U_{i+1} = \left[ \Delta U -f(t) \right] v^2 \Delta t^2 + 2 U_{i} - U_{i-1}$




2012-07-19