function [ n, x, y, z, w ] = prism_witherden_rule ( p )

%*****************************************************************************80
%
%% prism_witherden_rule() returns a prism quadrature rule of given precision.
%
%  Discussion:
%
%    A unit triangular prism has a triangular base in the (x,y) plane,
%    projected vertically one unit in the z direction.  
%
%    The vertices are 
%      (1,0,0), (0,1,0), (0,0,0), 
%      (1,0,1), (0,1,1), (0,0,1), 
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    17 May 2023
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Freddie Witherden, Peter Vincent,
%    On the identification of symmetric quadrature rules for finite element methods,
%    Computers and Mathematics with Applications,
%    Volume 69, pages 1232-1241, 2015.
%
%  Input:
%
%    integer p: the precision, 0 <= p <= 10.
%
%  Output:
%
%    integer n: the order of the rule.
%
%    real x(n), y(n), z(n): the coordinates of quadrature points.
%
%    real w(n): the quadrature weights.
%
  if ( p < 0 ) 
    error ( 'prism_witherden_rule(): Input p < 0.\n' );
  end

  if ( 20 < p )
    error ( 'prism_witherden_rule(): Input 10 < p.\n' );
  end

  n = rule_order ( p );
  if ( p == 0 )
    [ x, y, z, w ] = rule00 ( );
  elseif ( p == 1 )
    [ x, y, z, w ] = rule01 ( );
  elseif ( p == 2 )
    [ x, y, z, w ] = rule02 ( );
  elseif ( p == 3 )
    [ x, y, z, w ] = rule03 ( );
  elseif ( p == 4 )
    [ x, y, z, w ] = rule04 ( );
  elseif ( p == 5 )
    [ x, y, z, w ] = rule05 ( );
  elseif ( p == 6 )
    [ x, y, z, w ] = rule06 ( );
  elseif ( p == 7 )
    [ x, y, z, w ] = rule07 ( );
  elseif ( p == 8 )
    [ x, y, z, w ] = rule08 ( );
  elseif ( p == 9 )
    [ x, y, z, w ] = rule09 ( );
  elseif ( p == 10 )
    [ x, y, z, w ] = rule10 ( );
  end

  return
end

