%
%  2D swift-hoh with ETD -- set-up -- djm, 26 jan 2007
%
%  for movies, need:
%    a)  subdirectory "mov_dir"
%    b)  imagemagick command "convert", or similar animiated gif maker
%  unix:  convert -adjoin -delay 12 u_sol* movie.gif
%

%  plotting, etc
u = real(ifft2(uF));
disp(['[time umax umin umean] = ' ... 
    num2str([time max(u(:)) min(u(:)) sum(u(:))/Nx/Ny])]);
disp(['[|a_11| |a_13| |a_31| |a_33|] = ' ... 
    num2str((4/Nx/Ny)*[abs(uF(2,2)) abs(uF(2,4)) abs(uF(4,2)) abs(uF(4,4))])]);

%  periodize solution
uP = [u , u(:,1)];  uP = [uP ; uP(1,:)];

%  SH contours
figure(1);  clf;  hold on
pcolor([xx Lx],[yy Ly],uP);  shading interp;  colormap(cmap);  colorbar;
contour([xx Lx],[yy Ly],uP,12,'k');

title('\bf 2D Swift-Hohenberg');
text(pi/10,pi/10,num2str(time,3),'fontsize',18);
xlabel('\bf x-axis');  ylabel('\bf y-axis')
axis([0 Lx 0 Ly]);  axis image;

%  SH surface
figure(4);  clf;
surf([xx Lx],[yy Ly],uP);
axis([0 Lx 0 Ly -0.3 0.3])
title(['\bf 2D Swift-Hohenberg; t = ' num2str(time,3)],'fontsize',14);
xlabel('\bf x-axis');  ylabel('\bf y-axis')

%  movie
if(mkmovie==1)
    fname = sprintf('u_sol%.3d', fnum);
    filename = [mov_dir '/' fname];
    print('-dpng','-r75',filename)
    fnum = fnum + 1;
end

%  spectra
if(0==1)
end

drawnow

