function [ dim, vertices, edges, triangles, quadrilaterals, tetrahedrons, ...
    hexahedrons, vertex_coordinate, vertex_label, edge_vertex, edge_label, ...
    triangle_vertex, triangle_label, quadrilateral_vertex, ...
    quadrilateral_label, tetrahedron_vertex, tetrahedron_label, ...
    hexahedron_vertex, hexahedron_label ] = hexahexa_2x2x2 ( )

%*****************************************************************************80
%
%% HEXAHEXA_2x2x2 defines a 3D hexahedral mesh.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    23 December 2010
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Pascal Frey,
%    MEDIT: An interactive mesh visualization software,
%    Technical Report RT-0253,
%    Institut National de Recherche en Informatique et en Automatique,
%    03 December 2001.
%
%  Parameters:
%
%    Output, integer DIM, the spatial dimension, which should be 2 or 3.
%
%    Output, integer VERTICES, the number of vertices.
%
%    Output, integer EDGES, the number of edges (may be 0).
%
%    Output, integer TRIANGLES, the number of triangles (may be 0).
%
%    Output, integer QUADRILATERALS, the number of quadrilaterals (may be 0).
%
%    Output, integer TETRAHEDRONS, the number of tetrahedrons (may be 0).
%
%    Output, integer HEXAHEDRONS, the number of hexahedrons (may be 0).
%
%    Output, real VERTEX_COORDINATE(DIM,VERTICES), the coordinates
%    of each vertex.
%
%    Output, integer VERTEX_LABEL(VERTICES), a label for each vertex.
%
%    Output, integer EDGE_VERTEX(2,EDGES), the vertices that form each edge.
%
%    Output, integer EDGE_LABEL(EDGES), a label for each edge.
%
%    Output, integer TRIANGLE_VERTEX(3,TRIANGLES), the vertices that form
%    each triangle.
%
%    Output, integer TRIANGLE_LABEL(TRIANGLES), a label for each triangle.
%
%    Output, integer QUADRILATERAL_VERTEX(4,QUADRILATERALS), the vertices that
%    form each quadrilateral.
%
%    Output, integer QUADRILATERAL_LABEL(QUADRILATERALS), a label for
%    each quadrilateral.
%
%    Output, integer TETRAHEDRON_VERTEX(4,TETRAHEDRONS), the vertices that
%    form each tetrahedron.
%
%    Output, integer TETRAHEDRON_LABEL(TETRAHEDRONS), a label for
%    each tetrahedron.
%
%    Output, integer HEXAHEDRON_VERTEX(8,HEXAHEDRONS), the vertices that form
%    each hexahedron.
%
%    Output, integer HEXAHEDRON_LABEL(HEXAHEDRONS), a label for each hexahedron.
%
  dim = 3;
  vertices = 27;
  vertex_coordinate = [ ...
    0.0, 0.0, 0.0; ...
    0.5, 0.0, 0.0; ...
    1.0, 0.0, 0.0; ...
    0.0, 0.5, 0.0; ...
    0.5, 0.5, 0.0; ...
    1.0, 0.5, 0.0; ...
    0.0, 1.0, 0.0; ...
    0.5, 1.0, 0.0; ...
    1.0, 1.0, 0.0; ...
    0.0, 0.0, 0.5; ...
    0.5, 0.0, 0.5; ...
    1.0, 0.0, 0.5; ...
    0.0, 0.5, 0.5; ...
    0.5, 0.5, 0.5; ...
    1.0, 0.5, 0.5; ...
    0.0, 1.0, 0.5; ...
    0.5, 1.0, 0.5; ...
    1.0, 1.0, 0.5; ...
    0.0, 0.0, 1.0; ...
    0.5, 0.0, 1.0; ...
    1.0, 0.0, 1.0; ...
    0.0, 0.5, 1.0; ...
    0.5, 0.5, 1.0; ...
    1.0, 0.5, 1.0; ...
    0.0, 1.0, 1.0; ...
    0.5, 1.0, 1.0; ...
    1.0, 1.0, 1.0 ]';

  vertex_label = [ ...
    5; ...
    2; ...
    3; ...
    5; ...
    1; ...
    3; ...
    5; ...
    4; ...
    4; ...
    5; ...
    2; ...
    3; ...
    5; ...
    0; ...
    3; ...
    5; ...
    4; ...
    4; ...
    6; ...
    6; ...
    6; ...
    6; ...
    6; ...
    6; ...
    6; ...
    6; ...
    6 ]';

  edges = 0;
  edge_vertex = [];
  edge_label = [];

  triangles = 0;
  triangle_vertex = [];
  triangle_label = [];

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

  quadrilateral_label = [ ...
     1; ...
     1; ...
     1; ...
     1; ...
     2; ...
     2; ...
     2; ...
     2; ...
     3; ...
     3; ...
     3; ...
     3; ...
     4; ...
     4; ...
     4; ...
     4; ...
     5; ...
     5; ...
     5; ...
     5; ...
     6; ...
     6; ...
     6; ...
     6 ]';

  tetrahedrons = 0;
  tetrahedron_vertex = [];
  tetrahedron_label = [];

  hexahedrons = 8;

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

  hexahedron_label = [ ...
    1; ...
    1; ...
    1; ...
    1; ...
    1; ...
    1; ...
    1; ...
    1 ]';

  return
end
