function heat_transfer_test ( )

%*****************************************************************************80
%
%% heat_transfer_test() plots data computed by FreeFem++.
%
%  Licensing:
%
%    Copyright (C) 2018 Chloros2 <chloros2@gmx.de>
%
%    This program is free software: you can redistribute it and/or modify it
%    under the terms of the GNU General Public License as published by
%    the Free Software Foundation, either version 3 of the License, or
%    (at your option) any later version.
%
%    This program is distributed in the hope that it will be useful, but
%    WITHOUT ANY WARRANTY; without even the implied warranty of
%    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%    GNU General Public License for more details.
%
%    You should have received a copy of the GNU General Public License
%    along with this program.  If not, see
%    <https://www.gnu.org/licenses/>.
%
%  Modified:
%
%    2018-05-13
%
%  Author:
%
%    Chloros2 <chloros2@gmx.de>
%    Modifications by John Burkardt.
%
  addpath ( '../ffmatlib' );

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'heat_transfer_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  Make plots of data from a computation of heat\n' );
  fprintf ( 1, '  distribution in a disk, as computed by FreeFem++,\n' );
  fprintf ( 1, '  using the ffmatlib ( ) interface.\n' );

  clear ( 'all' );
%
%  Read the data from the FreeFem++ computation.
%
  [ p, b, t, nv, nbe, nt, labels ] = ffreadmesh ( 'heat_transfer.msh' );
  [ vh ] = ffreaddata ( 'heat_transfer_vh.txt' );
  [ u ] = ffreaddata ( 'heat_transfer_data.txt' );
%
%  3D Surf Plot Gouraud lighting
%
  figure ( );

  ffpdeplot ( p, b, t, ...
    'VhSeq',vh, ...
    'XYData',u, ...
    'ZStyle','continuous', ...
    'ColorMap',jet(150), ...
    'Mesh','off', ...
    'CBTitle','U', ...
    'Title','Gouraud' );
  ylabel ( 'y' );
  xlabel ( 'x' );
  zlabel ( 'u' );
  grid ( 'on' );
  lighting ( 'gouraud' );
  view ( [ -47, 24 ] );
  camlight ( 'headlight' );
  axis ( 'tight' );

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

  rmpath ( '../ffmatlib' );

  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

