GaussQuad

PURPOSE ^

GAUSSQUAD - get Gauss point for quad elements

SYNOPSIS ^

function [num_gauss,first_gauss_coord,second_gauss_coord,gauss_weights]=GaussQuad(order)

DESCRIPTION ^

GAUSSQUAD - get Gauss point for quad elements

   This routine computes gaussian points on a reference qud elements
   The number of gaussian points returned depends on the order of integration ('order'). The order of 
   integration can be computed from the polynomial degree p that needs to be integrated. The formula is: 
   order = (p+1) /2 
   order=1, num_gauss=1. Can integrate polynomials of degree 0 to 1

   Usage:
      [num_gauss,first_gauss_coord,second_gauss_coord,gauss_weights]=GaussQuad(order)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [num_gauss,first_gauss_coord,second_gauss_coord,gauss_weights]=GaussQuad(order)
0002 %GAUSSQUAD - get Gauss point for quad elements
0003 %
0004 %   This routine computes gaussian points on a reference qud elements
0005 %   The number of gaussian points returned depends on the order of integration ('order'). The order of
0006 %   integration can be computed from the polynomial degree p that needs to be integrated. The formula is:
0007 %   order = (p+1) /2
0008 %   order=1, num_gauss=1. Can integrate polynomials of degree 0 to 1
0009 %
0010 %   Usage:
0011 %      [num_gauss,first_gauss_coord,second_gauss_coord,gauss_weights]=GaussQuad(order)
0012 
0013 
0014 if order==1,
0015     num_gauss=1;
0016     gauss_weights=4;
0017     first_gauss_coord= 0;
0018     second_gauss_coord= 0;
0019 
0020 %order=2, num_gauss=2. Can integrate polynomials of degree 0 to 3
0021 elseif order==2,
0022     num_gauss=4;
0023     gauss_weights=[ 1, 1, 1, 1];
0024     first_gauss_coord=[ -0.57735026918962, 0.57735026918962, -0.57735026918962, 0.57735026918962];
0025     second_gauss_coord=[0.57735026918962, 0.57735026918962, -0.57735026918962, -0.57735026918962];
0026 
0027 %order=3, num_gauss=3. Can integrate polynomials of degree 0 to 5
0028 elseif order==3,
0029     num_gauss=9;
0030     gauss_weights=[ 0.30864197530864, 0.49382716049383, 0.30864197530864, 0.49382716049383, 0.79012345679012, 0.49382716049383, 0.30864197530864, 0.49382716049383, 0.30864197530864];
0031     first_gauss_coord=[ -0.77459666924148, 0, 0.77459666924148, -0.77459666924148, 0, 0.77459666924148, -0.77459666924148, 0, 0.77459666924148];
0032     second_gauss_coord=[ -0.77459666924148, -0.77459666924148, -0.77459666924148, 0, 0, 0, 0.77459666924148, 0.77459666924148, 0.77459666924148];
0033 
0034 else
0035     error('GaussQuad error message: order not supported yet');
0036 end

Generated on Sun 29-Mar-2009 20:22:55 by m2html © 2003