function [ node_xy, element_node, element_neighbor ] = example1_q4_mesh ( ...
  node_num, element_num )

%*****************************************************************************80
%
%% EXAMPLE1_Q4_MESH sets up example #1 Q4 mesh.
%
%  Discussion:
%
%    The appropriate values of NODE_NUM and ELEMENT_NUM can be found by
%    calling EXAMPLE1_Q4_MESH_SIZE first.
%
%   24---25---26---27---28
%    | 14 | 15 | 16 | 17 |
%   18---19---20---21---22---23
%    | 10 | -2 | 11 | 12 | 13 |
%   12---13---14---15---16---17
%    |  5 |  6 |  7 |  8 |  9 |
%    6----7----8----9---10---11
%    |  1 |  2 |  3 |  4 |
%    1----2----3----4----5
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    24 February 2009
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer NODE_NUM, the number of nodes.
%
%    Input, integer ELEMENT_NUM, the number of elements.
%
%    Output, real NODE_XY(2,NODE_NUM), the coordinates of the
%    nodes.
%
%    Output, integer ELEMENT_NODE(4,ELEMENT_NUM), the nodes
%    that make up the elements.
%
%    Output, integer ELEMENT_NEIGHBOR(4,ELEMENT_NUM), the
%    element neighbors on each side.  Negative values indicate edges that
%    lie on the exterior.
%
  node_xy = [ ...
       0.0, 0.0; ...
       1.0, 0.0; ...
       2.0, 0.0; ...
       3.0, 0.0; ...
       4.0, 0.0; ...
       0.0, 1.0; ...
       1.0, 1.0; ...
       2.0, 1.0; ...
       3.0, 1.0; ...
       4.0, 1.0; ...
       5.0, 1.0; ...
       0.0, 2.0; ...
       1.0, 2.0; ...
       2.0, 2.0; ...
       3.0, 2.0; ...
       4.0, 2.0; ...
       5.0, 2.0; ...
       0.0, 3.0; ...
       1.0, 3.0; ...
       2.0, 3.0; ...
       3.0, 3.0; ...
       4.0, 3.0; ...
       5.0, 3.0; ...
       0.0, 4.0; ...
       1.0, 4.0; ...
       2.0, 4.0; ...
       3.0, 4.0; ...
       4.0, 4.0 ]';

  element_node = [ ...
     1,  2,  7,  6; ...
     2,  3,  8,  7; ...
     3,  4,  9,  8; ...
     4,  5, 10,  9; ...
     6,  7, 13, 12; ...
     7,  8, 14, 13; ...
     8,  9, 15, 14; ...
     9, 10, 16, 15; ...
    10, 11, 17, 16; ...
    12, 13, 19, 18; ...
    14, 15, 21, 20; ...
    15, 16, 22, 21; ...
    16, 17, 23, 22; ...
    18, 19, 25, 24; ...
    19, 20, 26, 25; ...
    20, 21, 27, 26; ...
    21, 22, 28, 27 ]';

  element_neighbor = [ ...
       -1,  2,  5, -1; ...
       -1,  3,  6,  1; ...
       -1,  4,  7,  2; ...
       -1, -1,  8,  3; ...
        1,  6, 10, -1; ...
        2,  7, -2,  5; ...
        3,  8, 11,  6; ...
        4,  9, 12,  7; ...
       -1, -1, 13,  8; ...
        5, -2, 14, -1; ...
        7, 12, 16, -2; ...
        8, 13, 17, 11; ...
        9, -1, -1, 12; ...
       10, 15, -1, -1; ...
       -2, 16, -1, 14; ...
       11, 17, -1, 15; ...
       12, -1, -1, 16 ]';

  return
end
