-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgaussQuadrature.m
More file actions
113 lines (105 loc) · 5.86 KB
/
Copy pathgaussQuadrature.m
File metadata and controls
113 lines (105 loc) · 5.86 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
function [weights,locations] = gaussQuadrature(option)
% Gauss quadrature for 2D elements
% option 'third' (3x3)
% option 'complete' (2x2)
% option 'reduced' (1x1)
% locations: Gauss point locations
% weights: Gauss point weights
switch option
case 'third'
locations = [-0.774596669241483 -0.774596669241483;
0. -0.774596669241483;
0.774596669241483 -0.774596669241483;
-0.774596669241483 0.;
0. 0.;
0.774596669241483 0.;
-0.774596669241483 0.774596669241483;
0. 0.774596669241483;
0.774596669241483 0.774596669241483];
weights = [0.555555555555556*0.555555555555556;
0.555555555555556*0.888888888888889;
0.555555555555556*0.555555555555556;
0.888888888888889*0.555555555555556;
0.888888888888889*0.888888888888889;
0.555555555555556*0.888888888888889;
0.555555555555556*0.555555555555556;
0.555555555555556*0.888888888888889;
0.555555555555556*0.555555555555556];
case 'complete'
locations = [ -0.577350269189626 -0.577350269189626;
0.577350269189626 -0.577350269189626;
0.577350269189626 0.577350269189626;
-0.577350269189626 0.577350269189626];
weights = [1;1;1;1];
case 'reduced'
locations = [0 0];
weights = 4;
case 'Q1'
p = -1/sqrt(3);
q = 1/sqrt(3);
locations = [p, p, p; % Integration points. Gauss quadrature, weight = 1
p, p, q;
p, q, p;
p, q, q;
q, p, p;
q, p, q;
q, q, p;
q, q, q];
weights = [1;1;1;1;1;1;1;1];
case 'H20'
locations = [-0.774596669241483, -0.774596669241483, -0.774596669241483;
0.000000000000000, -0.774596669241483, -0.774596669241483;
0.774596669241483, -0.774596669241483, -0.774596669241483;
-0.774596669241483, 0.000000000000000, -0.774596669241483;
0.000000000000000, 0.000000000000000, -0.774596669241483;
0.774596669241483, 0.000000000000000, -0.774596669241483;
-0.774596669241483, 0.774596669241483, -0.774596669241483;
0.000000000000000, 0.774596669241483, -0.774596669241483;
0.774596669241483, 0.774596669241483, -0.774596669241483;
-0.774596669241483, -0.774596669241483, 0.000000000000000;
0.000000000000000, -0.774596669241483, 0.000000000000000;
0.774596669241483, -0.774596669241483, 0.000000000000000;
-0.774596669241483, 0.000000000000000, 0.000000000000000;
0.000000000000000, 0.000000000000000, 0.000000000000000;
0.774596669241483, 0.000000000000000, 0.000000000000000;
-0.774596669241483, 0.774596669241483, 0.000000000000000;
0.000000000000000, 0.774596669241483, 0.000000000000000;
0.774596669241483, 0.774596669241483, 0.000000000000000;
-0.774596669241483, -0.774596669241483, 0.774596669241483;
0.000000000000000, -0.774596669241483, 0.774596669241483;
0.774596669241483, -0.774596669241483, 0.774596669241483;
-0.774596669241483, 0.000000000000000, 0.774596669241483;
0.000000000000000, 0.000000000000000, 0.774596669241483;
0.774596669241483, 0.000000000000000, 0.774596669241483;
-0.774596669241483, 0.774596669241483, 0.774596669241483;
0.000000000000000, 0.774596669241483, 0.774596669241483;
0.774596669241483, 0.774596669241483, 0.774596669241483];
weights = [0.555555555555556*0.555555555555556*0.555555555555556;
0.888888888888889*0.555555555555556*0.555555555555556;
0.555555555555556*0.555555555555556*0.555555555555556;
0.555555555555556*0.888888888888889*0.555555555555556;
0.888888888888889*0.888888888888889*0.555555555555556;
0.555555555555556*0.888888888888889*0.555555555555556;
0.555555555555556*0.555555555555556*0.555555555555556;
0.888888888888889*0.555555555555556*0.555555555555556;
0.555555555555556*0.555555555555556*0.555555555555556;
0.555555555555556*0.555555555555556*0.888888888888889;
0.888888888888889*0.555555555555556*0.888888888888889;
0.555555555555556*0.555555555555556*0.888888888888889;
0.555555555555556*0.888888888888889*0.888888888888889;
0.888888888888889*0.888888888888889*0.888888888888889;
0.555555555555556*0.888888888888889*0.888888888888889;
0.555555555555556*0.555555555555556*0.888888888888889;
0.888888888888889*0.555555555555556*0.888888888888889;
0.555555555555556*0.555555555555556*0.888888888888889;
0.555555555555556*0.555555555555556*0.555555555555556;
0.888888888888889*0.555555555555556*0.555555555555556;
0.555555555555556*0.555555555555556*0.555555555555556;
0.555555555555556*0.888888888888889*0.555555555555556;
0.888888888888889*0.888888888888889*0.555555555555556;
0.555555555555556*0.888888888888889*0.555555555555556;
0.555555555555556*0.555555555555556*0.555555555555556;
0.888888888888889*0.555555555555556*0.555555555555556;
0.555555555555556*0.555555555555556*0.555555555555556];
end
end % end function gaussQuadrature