function diffusivity_1d_pwc_test ( )

%*****************************************************************************80
%
%% diffusivity_1d_pwc_contour tests diffusivity_1d_pwc.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    23 March 2019
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'diffusivity_1d_pwc_test\n' );
  fprintf ( 1, '  Test diffusivity_1d_pwc\n' );
%
%  Set up the piecewise constant values and breakpoints.
%
  nc = 10;
  xc = [ -0.9, -0.5, -0.45, -0.1, 0.2, 0.3, 0.32, 0.7, 0.85 ];
  vc = [  1.0,  1.5,  3.0,   1.2, 1.0, 0.8, 0.2,  0.4, 0.8, 1.0 ];
%
%  Sample the diffusivity.
%
  np = 100;
  xp = linspace ( -1.0, +1.0, np );
  vp = diffusivity_1d_pwc ( nc, xc, vc, np, xp );
%
%  Plot the diffusivity field.
%
  figure ( )
  plot ( xp, vp, 'LineWidth', 2 );
  grid on
  xlabel ( '<--- X --->', 'fontsize', 12 )
  ylabel ( '<--- \rho(X) --->', 'fontsize', 12 )
  title ( 'PWC stochastic diffusivity function', 'Fontsize', 18 )

  vp_max = max ( vp );
  axis ( [ -1.0, +1.0, 0.0, vp_max ] )

  filename = 'diffusivity_1d_pwc.png';
  print ( '-dpng', filename )
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Plot file stored as "%s".\n', filename );

  pause ( 5 );

  return
end
