GaussSegment

PURPOSE ^

GAUSSSEGMENT - get Gauss point for segment elements

SYNOPSIS ^

function [segment_coord,gauss_weights]=GaussSegment(numgauss)

DESCRIPTION ^

GAUSSSEGMENT - get Gauss point for segment elements

   This routine computes numgauss gaussian points on a reference segment from -1 to 1.
   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:
      [segment_coord,gauss_weights]=GaussSegment(numgauss)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [segment_coord,gauss_weights]=GaussSegment(numgauss)
0002 %GAUSSSEGMENT - get Gauss point for segment elements
0003 %
0004 %   This routine computes numgauss gaussian points on a reference segment from -1 to 1.
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 %      [segment_coord,gauss_weights]=GaussSegment(numgauss)
0012 
0013 if numgauss==1,
0014 
0015     segment_coord=0;
0016     gauss_weights=2;
0017 
0018 %p=3, numgauss=2. Can integrate polynomials of degree 0 to 3
0019 elseif numgauss==2,
0020     gauss_weights=[ 1.0, 1.0];
0021     segment_coord=[-0.577350269189626, 0.577350269189626];
0022 
0023 %p=5, numgauss=3. Can integrate polynomials of degree 0 to 5
0024 elseif numgauss==3,
0025     gauss_weights=[ 0.555555555555555556, 0.88888888888889, 0.555555555555555556];
0026     segment_coord=[ -0.774596669241483, 0.000000000000000, 0.774596669241483];
0027 
0028 %p=7, numgauss=4. Can integrate polynomials of degree 0 to 7
0029 elseif numgauss==4,
0030     gauss_weights=[ 0.347854845137454, 0.652145154862546, 0.652145154862546, 0.347854845137454];
0031     segment_coord=[ -0.861136311594053, -0.339981043584856, 0.339981043584856, 0.861136311594053];
0032 
0033 %p=9, numgauss=5. Can integrate polynomials of degree 0 to 9
0034 elseif numgauss==5,
0035     gauss_weights=[ 0.236926885056189, 0.478628670499366, 0.568888888888889, 0.478628670499366, 0.236926885056189];
0036     segment_coord=[ -0.906179845938664, -0.538469310105683, 0, 0.538469310105683, 0.906179845938664];
0037 
0038 
0039 else
0040     error('GaussSegment error message: order not supported yet');
0041 end

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