function diffusivity_2d_elman_contour ( )

%*****************************************************************************80
%
%% diffusivity_2d_elman_contour displays a contour plot of a 2D stochastic diffusivity function.
%
%  Discussion:
%
%    The diffusivity function is compute by DIFFUSIVITY_2D_ELMAN.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    08 February 2019
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Howard Elman, Darran Furnaval,
%    Solving the stochastic steady-state diffusion problem using multigrid,
%    IMA Journal on Numerical Analysis,
%    Volume 27, Number 4, 2007, pages 675-688.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'diffusivity_2d_elman_contour\n' );
  fprintf ( 1, '  Display contour or surface plots of the stochastic\n' );
  fprintf ( 1, '  diffusivity function defined by DIFFUSIVITY_2D_ELMAN.\n' );
%
%  Specify the X and Y evaluation points.
%
  nx = 51;
  a = 1.0;
  xvec = linspace ( -a, +a, nx );
  yvec = linspace ( -a, +a, nx );

  [ xmat, ymat ] = meshgrid ( xvec, yvec );
%
%  Sample OMEGA.
%
  m_1d = 5;
  msq = m_1d * m_1d;
  omega = randn ( msq, 1 );
%
%  Compute the diffusivity field.
%
  cl = 0.1;
  dc0 = 10.0;
  dc = diffusivity_2d_elman ( a, cl, dc0, m_1d, omega, nx, nx, xmat, ymat );
%
%  Make a surface plot.
%
  figure ( );
  surf ( ymat, xmat, dc, 'EdgeColor', 'interp' )
  xlabel ( '<--- Y --->', 'fontsize', 12 )
  ylabel ( '<--- X --->', 'fontsize', 12 )
  zlabel ( '<--- \rho(X,Y) --->', 'fontsize', 12 )
  title ( 'ELMAN Stochastic diffusivity function', 'Fontsize', 18 )

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

  pause ( 5 );

  return
end
