function elliptic_wavefront_test ( )

%*****************************************************************************80
%
%% ELLIPTIC_WAVEFRONT_TEST solves the elliptic PDE for the wave front test.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    14 February 2003
%
%  Author:
%
%    John Burkardt
%
  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'ELLIPTIC_WAVEFRONT_TEST:\n' );
  fprintf ( 1, '  MATLAB version\n' );
%
%  Remember where you are.
%
  base = pwd;
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Initial directory = %s\n', base );
%
%  Update the MATLAB path for IFISS3.3.
%
  setpath ( )
%
%  Set the grid information.
%
  nc = 4;
  elliptic_wavefront_domain ( nc );
%
%  Load the data.
%
  cd ( base );
  load ( '../../m_src/ifiss3.3/datafiles/elliptic_wavefront_grid.mat' );
%
%  Plot the macrogrid.
%
  macrogridplot ( xy, mv, bound, mbound );
  filename = strcat ( base, '/solution.png' );
  print ( '-dpng', filename );
%
%  Print the element definitions.
%
  disp ( mv );
%
%  Generate a bilinear approximation.
%
% [ ev, ebound ] = q1grid ( xy, mv, bound, mbound );
% filename = strcat ( base, '/q1grid.png' );
% print ( '-dpng', filename );
%
%  Show the grid.
%
% gridplot ( xy, ev, bound, ebound );
% filename = strcat ( base, '/gridplot.png' );
% print ( '-dpng', filename );
%
%  Define the geometry;
%
  pde = 1; 
  domain = 8;
  global viscosity
  viscosity = 1.0;

% load ( '../../m_src/ifiss3.3/datafiles/elliptic_wavefront_grid.mat' )
%
%  Set up the geometry arrays.
% 
  qmethod = 2;
  [ x, y, xy ] = q2grid ( x, y, xy, mv, bound );
%
%  Set up the stiffness and mass matrices and right hand side.
%
  [ A, M, f ] = elliptic_wavefront_femq2_diff ( xy, mv );
%
%  Apply the boundary conditions.
%
  [ Agal, fgal ] = elliptic_wavefront_nonzerobc ( A, f, xy, bound );
%
%  Save the resulting system
% 
  fprintf ( 1, '  System saved in elliptic_wavefront_diff.mat\n')
  gohome
  cd datafiles
  save elliptic_wavefront_diff.mat qmethod Agal M fgal xy x y 
%
%  Compute the solution.
%
  fprintf ( 1, '  Solving linear system\n')
  x_gal = Agal \ fgal;
  fprintf ( 1, '  Solution computed\n' );

  save elliptic_wavefront_diff.mat x_gal -append
%
%  Plot the solution
%
  figure_num = 10;
  solplot ( x_gal, xy, x, y, figure_num );
  title ( 'Elliptic Wavefront Solution' )
  drawnow
  filename = strcat ( base, '/solution.png' );
  print ( figure_num, '-dpng', filename );
%
%  Return to the starting directory.
%
  cd ( base )
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Returned to starting directory.\n' );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'ELLIPTIC_WAVEFRONT_TEST:\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  return
end
function timestamp ( )

%*****************************************************************************80
%
%% TIMESTAMP prints the current YMDHMS date as a timestamp.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    14 February 2003
%
%  Author:
%
%    John Burkardt
%
  t = now;
  c = datevec ( t );
  s = datestr ( c, 0 );
  fprintf ( 1, '%s\n', s );

  return
end
