-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathquadData.m
201 lines (188 loc) · 5.63 KB
/
quadData.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
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
function [qPts, qPtsb, W, Wb] = quadData(n)
% ------------------------------------------------------------------------%
% QUADDATA: This function simply stores the quadrature points for different
% quadrature rules. The default in TriGA is to use a 28 point quadrature
% rule over triangules and a 5 point quadrature rule over edges. However
% the user can also choose to specify a 16 point or 37 point quad rule over
% the triangle.
% INPUT:
% n: The number of quadrature rules to use over the triangle.
% OUTPUT:
% qPts: a nx2 array containing the quadrature points over the parent unit
% triangle.
% qPTsb: a 1x5 array containing the quadrature points along [-1 1].
% W: an nx1 array contianing the weights for the quad rule over the
% triangle.
% Wb: a 5x1 array containing the weights for the quad rule over [-1 1].
% ------------------------------------------------------------------------%
if n == 16
qPts = [0.0571 0.0655;...
0.2768 0.0502;...
0.5836 0.0289;...
0.8602 0.0097;...
0.0571 0.3112;...
0.2768 0.2386;...
0.5836 0.1374;...
0.8602 0.0461;...
0.0571 0.6317;...
0.2768 0.4845;...
0.5836 0.2790;...
0.8602 0.0936;...
0.0571 0.8774;...
0.2768 0.6729;...
0.5836 0.3875;...
0.8602 0.1301];
W = [0.0236;...
0.0354;...
0.0226;...
0.0054;...
0.0442;...
0.0663;...
0.0423;...
0.0102;...
0.0442;...
0.0663;...
0.0423;...
0.0102;...
0.0236;...
0.0354;...
0.0226;...
0.0054];
elseif n == 28
qPts = [0.333333333333333 0.333333333333333;...
0.948021718143423 0.025989140928288;...
0.025989140928288 0.948021718143423;...
0.025989140928288 0.025989140928288;...
0.811424994704155 0.094287502647923;...
0.094287502647923 0.811424994704155;...
0.094287502647923 0.094287502647923;...
0.010726449965571 0.494636775017215;...
0.494636775017215 0.010726449965571;...
0.494636775017215 0.494636775017215;...
0.585313234770972 0.207343382614514;...
0.207343382614514 0.585313234770972;...
0.207343382614514 0.207343382614514;...
0.122184388599019 0.438907805700491;...
0.438907805700491 0.122184388599019;...
0.438907805700491 0.438907805700491;...
0.677937654882590 0.044841677589131;...
0.677937654882590 0.277220667528279;...
0.044841677589131 0.677937654882590;...
0.044841677589131 0.277220667528279;...
0.277220667528279 0.677937654882590;...
0.277220667528279 0.044841677589131;...
0.858870281282636 0;...
0.858870281282636 0.141129718717364;...
0 0.858870281282636;...
0 0.141129718717364;...
0.141129718717364 0.858870281282636;...
0.141129718717364 0];
W = [ 0.043988650581111;...
0.004372155776868;...
0.004372155776868;...
0.004372155776868;...
0.019040785996968;...
0.019040785996968;...
0.019040785996968;...
0.009427724028066;...
0.009427724028066;...
0.009427724028066;...
0.036079848772370;...
0.036079848772370;...
0.036079848772370;...
0.034664569352769;...
0.034664569352769;...
0.034664569352769;...
0.020528157714644;...
0.020528157714644;...
0.020528157714644;...
0.020528157714644;...
0.020528157714644;...
0.020528157714644;...
0.003681191891650;...
0.003681191891650;...
0.003681191891650;...
0.003681191891650;...
0.003681191891650;...
0.003681191891650];
elseif n == 37
qPts = [0.3333 0.3333;...
0.9503 0.0249;...
0.0249 0.9503;...
0.0249 0.0249;...
0.1716 0.4142;...
0.4142 0.1716;...
0.4142 0.4142;...
0.5394 0.2303;...
0.2303 0.5394;...
0.2303 0.2303;...
0.7722 0.1139;...
0.1139 0.7722;...
0.1139 0.1139;...
0.0091 0.4955;...
0.4955 0.0091;...
0.4955 0.4955;...
0.0623 0.4689;...
0.4689 0.0623;...
0.4689 0.4689;...
0.0221 0.8513;...
0.0221 0.1266;...
0.8513 0.0221;...
0.8513 0.1266;...
0.1266 0.0221;...
0.1266 0.8513;...
0.0186 0.6894;...
0.0186 0.2919;...
0.6894 0.0186;...
0.6894 0.2919;...
0.2919 0.0186;...
0.2919 0.6894;...
0.0965 0.6359;...
0.0965 0.2676;...
0.6359 0.0965;...
0.6359 0.2676;...
0.2676 0.0965;...
0.2676 0.6359];
W = [0.0259;...
0.0040;...
0.0040;...
0.0040;...
0.0234;...
0.0234;...
0.0234;...
0.0233;...
0.0233;...
0.0233;...
0.0155;...
0.0155;...
0.0155;...
0.0054;...
0.0054;...
0.0054;...
0.0161;...
0.0161;...
0.0161;...
0.0077;...
0.0077;...
0.0077;...
0.0077;...
0.0077;...
0.0077;...
0.0089;...
0.0089;...
0.0089;...
0.0089;...
0.0089;...
0.0089;...
0.0185;...
0.0185;...
0.0185;...
0.0185;...
0.0185;...
0.0185];
else
disp('Invalid Number of quad points.')
end
qPtsb = [ 0 -0.538469310105683 0.538469310105683 -0.906179845938664 0.906179845938664];
Wb = [0.568888888888889 0.478628670499366 0.478628670499366 0.236926885056189 0.236926885056189];
return