The water surface evolution is calculated in time steps, we shall concentrate on the initial conditions as on the boundary conditions.
The area is divided to finite surface elements of constant depth according to the seafloor steps - randomly distributed for defined standard deviation in the propagation direction, and uniformly distributed in the transverse direction. About the boundary conditions, the boundaries between the F.E.M. calculation elements kept continuous (the hight and the slope) while for the external boundaries I have used periodic boundary conditions (around the whole mesh). The effect of the periodic boundary condition can be more easily understood after viewing the gif on the bottom of this page, which displays the regular shore area doubled twice at each direction (two farther replicas were darkenrd in order to indicate the transition between the regions).
The initial conditions were computed according to momentum (k) distribution caused by onshore wind (wind blowing to shore direction).
The time evolution calculated for each area using the Airy wave dispersion relation, for the real machine time (Matlab's tic & toc). Each step was computed in k space and Fourier transformed into x space in order to be displayed to the viewer.
For comfortable observation of the first upcoming wave, the water is perfectly smooth (i.e. of zero height) before it.gif player by alex pankratov.