0001 function [w,x,y,z]=gauss_points(dim,order)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 if(dim==1)
0030 if(order==2)
0031 [w,x,y,z]=dim_1_order_2;
0032 elseif(order==4)
0033 [w,x,y,z]=dim_1_order_4;
0034 elseif(order==6)
0035 [w,x,y,z]=dim_1_order_6;
0036 elseif(order==9)
0037 [w,x,y,z]=dim_1_order_9;
0038 else
0039 error('Integration order not recognised for dimension');
0040 end
0041 elseif(dim==2)
0042 if(order==0)
0043 [w,x,y,z]=dim_2_order_0;
0044 elseif(order==2)
0045 [w,x,y,z]=dim_2_order_2;
0046 elseif(order==4)
0047 [w,x,y,z]=dim_2_order_4;
0048 elseif(order==5)
0049 [w,x,y,z]=dim_2_order_5;
0050 elseif(order==7)
0051 [w,x,y,z]=dim_2_order_7;
0052 else
0053 error('Integration order not recognised for dimension');
0054 end
0055 elseif(dim==3)
0056 if(order==0)
0057 [w,x,y,z]=dim_3_order_0;
0058 elseif(order==2)
0059 [w,x,y,z]=dim_3_order_2;
0060 elseif(order==4)
0061 [w,x,y,z]=dim_3_order_4;
0062 else
0063 error('Integration order not recognised for dimension');
0064 end
0065
0066 else
0067 error('Dimension not recognised');
0068 end
0069
0070
0071
0072 function [w,x,y,z] = dim_1_order_2
0073
0074 w(1)=1.0; x(1)=1.0/sqrt(3.0); y(1)=0.0; z(1)=0.0;
0075 w(2)=1.0; x(2)=-1.0/sqrt(3.0); y(2)=0.0; z(2)=0.0;
0076 end
0077
0078
0079 function [w,x,y,z] = dim_1_order_4
0080
0081 w1=sqrt(3.0/5.0);
0082 w(1)=8.0/9.0; x(1)=0.0; y(1)=0.0; z(1)=0.0;
0083 w(2)=5.0/9.0; x(2)=w1; y(2)=0.0; z(2)=0.0;
0084 w(3)=5.0/9.0; x(3)=-w1; y(3)=0.0; z(3)=0.0;
0085 end
0086
0087
0088 function [w,x,y,z] = dim_1_order_6
0089
0090 w1=(18.0+sqrt(30.0))/36.0; w2=(18.0-sqrt(30.0))/36.0;
0091 p1=sqrt((3.0-2.0*sqrt(6.0/5.0))/7.0);
0092 p2=sqrt((3.0+2.0*sqrt(6.0/5.0))/7.0);
0093 w(1)=w1; x(1)=p1; y(1)=0.0; z(1)=0.0;
0094 w(2)=w1; x(2)=-p1; y(2)=0.0; z(2)=0.0;
0095 w(3)=w2; x(3)=p2; y(3)=0.0; z(3)=0.0;
0096 w(4)=w2; x(4)=-p2; y(4)=0.0; z(4)=0.0;
0097 end
0098
0099
0100 function [w,x,y,z] = dim_1_order_9
0101
0102 w1=128/225;
0103 w2=(322.0 + 13.0*sqrt(70.0))/900.0;
0104 w3=(322.0 - 13.0*sqrt(70.0))/900.0;
0105 p1=sqrt( 5.0 - 2.0*sqrt(10.0/7.0) )/3.0;
0106 p2=sqrt( 5.0 + 2.0*sqrt(10.0/7.0) )/3.0;
0107 w(1)=w1; x(1)=0; y(1)=0.0; z(1)=0.0;
0108 w(2)=w2; x(2)=p1; y(2)=0.0; z(2)=0.0;
0109 w(3)=w2; x(3)=-p1; y(3)=0.0; z(3)=0.0;
0110 w(4)=w3; x(4)=p2; y(4)=0.0; z(4)=0.0;
0111 w(5)=w3; x(5)=-p2; y(5)=0.0; z(5)=0.0;
0112 end
0113
0114
0115
0116 function [w,x,y,z] = dim_2_order_0
0117
0118 w(1)=1.0/2.0; x(1)=1.0/3.0; y(1)=1.0/3.0; z(1)=0.0;
0119 end
0120
0121
0122 function [w,x,y,z] = dim_2_order_2
0123
0124 w(1)=1.0/6.0; x(1)=2.0/3.0; y(1)=1.0/6.0; z(1)=0.0;
0125 w(2)=1.0/6.0; x(2)=1.0/6.0; y(2)=1.0/6.0; z(2)=0.0;
0126 w(3)=1.0/6.0; x(3)=1.0/6.0; y(3)=2.0/3.0; z(3)=0.0;
0127 end
0128
0129
0130 function [w,x,y,z] = dim_2_order_4
0131
0132 w(1)=0.5*0.2233815896780; x(1)=0.1081030181681; y(1)=0.4459484909160; z(1)=0.0;
0133 w(2)=0.5*0.2233815896780; x(2)=0.4459484909160; y(2)=0.1081030181681; z(2)=0.0;
0134 w(3)=0.5*0.2233815896780; x(3)=0.4459484909160; y(3)=0.4459484909160; z(3)=0.0;
0135 w(4)=0.5*0.1099517436553; x(4)=0.8168475729805; y(4)=0.0915762135098; z(4)=0.0;
0136 w(5)=0.5*0.1099517436553; x(5)=0.0915762135098; y(5)=0.0915762135098; z(5)=0.0;
0137 w(6)=0.5*0.1099517436553; x(6)=0.0915762135098; y(6)=0.8168475729805; z(6)=0.0;
0138 end
0139
0140
0141 function [w,x,y,z]=dim_2_order_5
0142
0143 w(1)=0.5*0.1259391805448; x(1)=0.1012865073235; y(1)=0.1012865073235; z(1)=0.0;
0144 w(2)=0.5*0.1259391805448; x(2)=0.7974269853531; y(2)=0.1012865073235; z(2)=0.0;
0145 w(3)=0.5*0.1259391805448; x(3)=0.1012865073235; y(3)=0.7974269853531; z(3)=0.0;
0146 w(4)=0.5*0.1323941527885; x(4)=0.4701420641051; y(4)=0.0597158717898; z(4)=0.0;
0147 w(5)=0.5*0.1323941527885; x(5)=0.4701420641051; y(5)=0.4701420641051; z(5)=0.0;
0148 w(6)=0.5*0.1323941527885; x(6)=0.0597158717898; y(6)=0.4701420641051; z(6)=0.0;
0149 w(7)=0.5*0.225; x(7)=0.3333333333333; y(7)=0.3333333333333; z(7)=0.0;
0150 end
0151
0152
0153 function [w,x,y,z]=dim_2_order_7
0154
0155 w(1)=0.5*0.0533472356088;x(1)=0.0651301029022; y(1)=0.0651301029022; z(1)=0.0;
0156 w(2)=0.5*0.0533472356088;x(2)=0.8697397941956; y(2)=0.0651301029022; z(2)=0.0;
0157 w(3)=0.5*0.0533472356088;x(3)=0.0651301029022; y(3)=0.8697397941956; z(3)=0.0;
0158 w(4)=0.5*0.0771137608903;x(4)=0.3128654960049; y(4)=0.0486903154253; z(4)=0.0;
0159 w(5)=0.5*0.0771137608903;x(5)=0.6384441885698; y(5)=0.3128654960049; z(5)=0.0;
0160 w(6)=0.5*0.0771137608903;x(6)=0.0486903154253; y(6)=0.6384441885698; z(6)=0.0;
0161 w(7)=0.5*0.0771137608903;x(7)=0.6384441885698; y(7)=0.0486903154253; z(7)=0.0;
0162 w(8)=0.5*0.0771137608903;x(8)=0.3128654960049; y(8)=0.6384441885698; z(8)=0.0;
0163 w(9)=0.5*0.0771137608903;x(9)=0.0486903154253; y(9)=0.3128654960049; z(9)=0.0;
0164 w(10)=0.5*0.1756152574332;x(10)=0.2603459660790; y(10)=0.2603459660790; z(10)=0.0;
0165 w(11)=0.5*0.1756152574332;x(11)=0.4793080678419; y(11)=0.2603459660790; z(11)=0.0;
0166 w(12)=0.5*0.1756152574332;x(12)=0.2603459660790; y(12)=0.4793080678419; z(12)=0.0;
0167 w(13)=-0.5*0.1495700444677;x(13)=0.3333333333333; y(13)=0.3333333333333; z(13)=0.0;
0168 end
0169
0170
0171
0172 function [w,x,y,z] = dim_3_order_0
0173
0174 w(1)=1.0/6.0; x(1)=1.0/4.0; y(1)=1.0/4.0; z(1)=1.0/4.0;
0175 end
0176
0177
0178 function [w,x,y,z] = dim_3_order_2
0179
0180 a=(5+3*sqrt(5))/20; b=(5-sqrt(5))/20;
0181 w(1)=1.0/24.0; x(1)=a; y(1)=b; z(1)=b;
0182 w(2)=1.0/24.0; x(2)=b; y(2)=a; z(2)=b;
0183 w(3)=1.0/24.0; x(3)=b; y(3)=b; z(3)=a;
0184 w(4)=1.0/24.0; x(4)=b; y(4)=b; z(4)=b;
0185 end
0186
0187
0188 function [w,x,y,z] = dim_3_order_4
0189
0190 a=0.25;
0191 w(1)=-0.0131555555555555556;
0192 x(1)=a; y(1)=a; z(1)=a;
0193
0194 a=0.785714285714285714; b=0.0714285714285714285;
0195 w(2)=0.00762222222222222222;
0196 x(2)=a; y(2)=b; z(2)=b;
0197 w(3)=0.00762222222222222222;
0198 x(3)=b; y(3)=a; z(3)=b;
0199 w(4)=0.00762222222222222222;
0200 x(4)=b; y(4)=b; z(4)=a;
0201 w(5)=0.00762222222222222222;
0202 x(5)=b; y(5)=b; z(5)=b;
0203
0204 a=0.399403576166799219; b=0.100596423833200785;
0205 w(6)=0.0248888888888888889;
0206 x(6)=a; y(6)=a; z(6)=b;
0207 w(7)=0.0248888888888888889;
0208 x(7)=a; y(7)=b; z(7)=b;
0209 w(8)=0.0248888888888888889;
0210 x(8)=b; y(8)=b; z(8)=a;
0211 w(9)=0.0248888888888888889;
0212 x(9)=b; y(9)=a; z(9)=b;
0213 w(10)=0.0248888888888888889;
0214 x(10)=b; y(10)=a; z(10)=a;
0215 w(11)=0.0248888888888888889;
0216 x(11)=a; y(11)=b; z(11)=a;
0217 end
0218
0219 end