function paraheat_gaussian_test ( diffusivity_seed )

%*****************************************************************************80
%
%% paraheat_gaussian_test tests paraheat_gaussian.
%
%  Discussion:
%
%    This program uses the random number seed to choose parameters 
%    (xc,yc), sc, vc as input to the paraheat_gaussian() program, and 
%    saves the resulting sensor measurements ns, xs, ys, vs.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    08 May 2019
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer diffusivity_seed, the seed for the random number
%    generator, used to set the diffusivity values.
%
  addpath ( '../paraheat_gaussian' );

  timestamp ( );
  fprintf ( 1, 'paraheat_gaussian_test\n' );
  fprintf ( 1, '  MATLAB version\n' );
  fprintf ( 1, '  Test paraheat_gaussian\n' );
  fprintf ( 1, '  For given piecewise constant diffusivity data,\n' );
  fprintf ( 1, '  use paraheat_gaussian() to compute an FEM solution u(x,y),\n' );
  fprintf ( 1, '  and return sample solution values at sensor locations.\n' );
  fprintf ( 1, '\n' );

  fprintf ( 1, '  Diffusivity random seed is %d\n', diffusivity_seed );
%
%  Set the diffusivity.
%
  rng ( diffusivity_seed );
  [ xmin, xmax, ymin, ymax ] = region_box ( );
  xc = xmin + ( xmax - xmin ) * rand ( 1, 1 );
  yc = ymin + ( ymax - ymin ) * rand ( 1, 1 );
  sc = 0.05 + 0.95 * rand ( 1, 1 );
  vc = 0.5 + 4.5 * rand ( 1, 1 );
%
%  Solve the finite element system, and return samples of the solution.
%
  [ ns, xs, ys, vs ] = paraheat_gaussian ( xc, yc, sc, vc );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'paraheat_gaussian_test\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  timestamp ( );

  rmpath ( '../paraheat_gaussian' );

  return
end
function [ xmin, xmax, ymin, ymax ] = region_box ( )

%*****************************************************************************80
%
%% region_box returns the minimum and maximum x and y values of the region.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    10 April 2019
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Output, real XMIN, XMAX, YMIN, YMAX, the argument ranges.
%
  xmin = 0.0;
  xmax = 1.0;
  ymin = 0.0;
  ymax = 1.0;

  return
end
