function grid_t3_neighbor_test ( )

%*****************************************************************************80
%
%% grid_t3_neighbor_test() tests grid_t3_neighbor().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    06 April 2019
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'grid_t3_neighbor_test():\n' );
  fprintf ( 1, '  Test grid_t3_neighbor()\n' );

  nelemx = 3;
  nelemy = 2;

  fprintf ( 1, '  Number of elements in X direction = %d\n', nelemx );
  fprintf ( 1, '  Number of elements in Y direction = %d\n', nelemy );

  code = 't3';

  element_order = order_code ( code );

  node_num = grid_node_num ( code, nelemx, nelemy );

  fprintf ( 1, '  Element order =       %d\n', element_order );
  fprintf ( 1, '  Nodes in grid =       %d\n', node_num );

  element_num = grid_element_num ( code, nelemx, nelemy );

  element_node = grid_element ( code, element_order, nelemx, nelemy );

  grid_print ( element_order, element_num, element_node );

  width = grid_width ( element_order, element_num, element_node );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  The grid width is %d\n', width );

  neighbor = grid_t3_neighbor ( nelemx, nelemy );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Element neighbor array:\n' );
  fprintf ( 1, '\n' );

  for e = 1 : element_num
    fprintf ( 1, '  %2d:  %2d  %2d  %2d\n', e, neighbor(1:3,e) );
  end

  return
end
