/* tdif.java Time domain 15-degree diffraction movie. Star: w=p(t,z) y=p(t,z+1) u=p(t+1,z) v=p(t+1,z+1) Adapted from Jon Claerbout's Imaging the Earth's Interior (1985), p. 136, by John N. Louie, 30 November 1998. */ /* Include the usual classes */ import java.util.*; import java.io.*; import java.lang.Math; /* Declare a class to contain tdif as a main method, referring to the class imhf.rtris() static method. */ /* When you change the code in this file, make a copy to a new file with a new name like "ex2tdif.java", and be sure to make the same change to the class name below - e.g. "class ex2tdif" */ class tdif { /* The main() method compiles into a file named "tdif.class" that you run in the Java virtual machine as a stand-alone application with a command such as "java tdif"; or whatever you have renamed the class and file. */ public static void main(String args[]) /* No runtime arguments needed */ { System.out.println("Starting tdif..."); /* Declare variables */ int i, ix, nx, iz, nz, it, nt, ip; float alfa, beta, diag, offdi, apb, amb, dd; /* Initialize constants */ nx = 36; nz = 96; nt = 96; /* v*dz*dt/(8*dx*dx) */ alfa = 0.125F; /* Accurate x derivative parameter; simplest case b=0 */ beta = 0.140F; /* Declare and initialize volume and vectors to zero values */ FltVol p = new FltVol(nz/2+1, nz, nx+1); /* Note that tdif operates in rows of x, for the convenience of the rtris() method. The number of planes is linked to the first loop below (and to the velocity used); and there is an extra column for a depth pointer. */ float[] u = new float[nx]; float[] w = new float[nx]; float[] v = new float[nx]; float[] y = new float[nx]; float[] e = new float[nx]; float[] f = new float[nx]; float[] d = new float[nx]; /* Set up initial model of 4 band-limited "point" scatterers */ for (iz=nz/5-1; iz0 && ip