function dg1d_advection_test ( )

%*****************************************************************************80
%
%% dg1d_advection_test() tests dg1d_advection().
%
%  Licensing:
%
%    Permission to use this software for noncommercial
%    research and educational purposes is hereby granted
%    without fee.  Redistribution, sale, or incorporation
%    of this software into a commercial product is prohibited.
%
%    The authors or publisher disclaims any and all warranties
%    with regard to this software, including all implied
%    warranties of merchantability and fitness for any
%    particular purpose.  In no event shall the authors or
%    the publisher be liable for any special, indirect or
%    consequential damages or any damages whatsoever
%    resulting from loss of use, data or profits.
%
%  Modified:
%
%    04 January 2019
%
%  Author:
%
%    Original version by Jan Hesthaven, Tim Warburton.
%    Some modifications by John Burkardt.
%
%  Reference:
%
%    Jan Hesthaven, Tim Warburton,
%    Nodal Discontinuous Galerkin Methods: 
%    Algorithms, Analysis, and Applications,
%    Springer, 2007,
%    ISBN: 978-0387720654.
%
  addpath ( '../dg1d_advection' )

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, ' dg1d_advection_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  Test dg1d_advection().\n' );

  Globals1D;
%
%  Order of polymomials used for approximation.
%
  N = 8;
  Elements = 10;
%
%  Generate simple mesh.
%
  [ Nv, VX, K, EToV ] = MeshGen1D ( 0.0, 2.0, Elements );
%
%  Initialize solver and construct grid and metric
%
  StartUp1D ( );
%
%  Set initial conditions.
%
  u = sin ( x );
%
%  Solve the Problem.
%
  FinalTime = 10.0;
  u = Advec1D ( u, FinalTime );

  filename = 'dg1d_advection_test.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'dg1d_advection_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../dg1d_advection' )

  return
end
function timestamp ( )

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

  return
end

