forked from mhscott/G2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGauss.m
executable file
·38 lines (28 loc) · 1.12 KB
/
Gauss.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
function [xIP,weight] = Gauss (nIP)
% locations (xIP) and weights (weight) for nIP integration points
switch nIP
case 2
xIP = [ -.57735026918963,.57735026918963]';
weight = [ 1.,1.]';
case 3
xIP = [-0.77459666924148,0.0,0.77459666924148]';
weight = [.55555555556,.88888888889,.55555555556]';
case 4
xIP = [-.8611363116,-.3399810436,.3399810436,.8611363116]';
weight = [.3478548451,.6521451549,.6521451549,.3478548451]';
case 5
xIP = [-.9061798459,-.5384693101,0.0,.5384693101,.9061798459]';
weight = [.236926885,.4786286705,.5688888889,.4786286705,.236926885]';
case 6
xIP = [-.9324695142,-.6612093865,-.2386191861, ...
.2386191861, .6612093865, .9324695142]';
weight = [.1713244924,.3607615730,.4679139346, ...
.4679139346,.3607615730,.1713244924]';
case 7
xIP = [-.9491079123,-.7415311856,-.4058451514,0., ...
.4058451514, .7415311856, .9491079123]';
weight = [.1294849662,.2797053915,.3818300505,.4179591837, ...
.3818300505,.2797053915,.1294849662]';
otherwise
error('Invalid order for Gauss integration.')
end