function distmesh_3d_test ( )

%*****************************************************************************80
%
%% distmesh_3d_test() tests distmesh_3d().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    12 September 2005
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Per-Olof Persson and Gilbert Strang,
%    A Simple Mesh Generator in MATLAB,
%    SIAM Review,
%    Volume 46, Number 2, June 2004, pages 329-345.
%
%  Local:
%
%    integer ITERATION_MAX, the maximum number of iterations that DISTMESH
%    should take.  (The program might take fewer iterations if it detects
%    convergence.)
%
%    real H, the desired initial spacing.  If a uniform mesh density is used,
%    this is the approximate spacing throughout the region.
%
%    pointer FH, an inline formula, or the name of an M file, which calculates
%    the mesh density function.
%
  addpath ( '../distmesh_3d');

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'DISTMESH_3D()\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  Test DISTMESH_3D().\n' );
%
%  Problem 1.
%
  figure ( 1 )
  iteration_max = 200;
  h = 0.40;
  fh = @fh01;
  distmesh_3d_test01 ( iteration_max );
  filename = 'distmesh_3d_test01.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  Problem 2.
%
  figure ( 2 )
  iteration_max = 200;
  h = 0.10;
  fh = @fh02;
  distmesh_3d_test02 ( iteration_max );
  filename = 'distmesh_3d_test02.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );%
%  Problem 3.
%
  figure ( 3 )
  iteration_max = 200;
  h = 0.15;
  fh = @fh03;
  distmesh_3d_test03 ( iteration_max );
  filename = 'distmesh_3d_test03.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );%
%  Problem 4.
%
  figure ( 4 )
  iteration_max = 200;
  h = 0.1;
  fh = @fh04;
  distmesh_3d_test04 ( iteration_max );
  filename = 'distmesh_3d_test04.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  Problem 5.
%
  figure ( 5 )
  iteration_max = 200;
  h = 0.1;
  fh = @fh05;
  distmesh_3d_test05 ( iteration_max );
  filename = 'distmesh_3d_test05.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'DISTMESH_3D():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../distmesh_3d' );

  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

