-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGetQuadratureTriangle.jl
94 lines (89 loc) · 6.33 KB
/
GetQuadratureTriangle.jl
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
function GetQuadratureTriangle(Q)
"""
Gauss quadrature rules for triangular domain
"""
""" 1 point rule on triangle. Order 1 """
if Q == 1
w = [2.0]
q = [-0.333333333333334 -0.333333333333334]
""" 3 point rule on triangle. Order 2 """
elseif Q == 3
w = [2.0/3.0; 2.0/3.0; 2.0/3.0]
q = [1.0/3.0 -2.0/3.0;
-2.0/3.0 1.0/3.0;
-2.0/3.0 -2.0/3.0]
""" 4 point rule on triangle. Order 3 """
elseif Q == 4
w = 4*[-27.0/96.0; 25.0/96.0; 25.0/96.0; 25.0/96.0]
q = [-1.0/3.0 -1.0/3.0;
-3.0/5.0 -3.0/5.0;
-3.0/5.0 1.0/5.0;
1.0/5.0 -3.0/5.0]
""" 6 point rule on triangle. Order 4 """
elseif Q == 6
P1 = 4*0.11169079483905
P2 = 4*0.0549758718227661
A = -0.10810301816807
B = -0.8168475729804581
w = [P2; P2; P2; P1; P1; P1]
q = [B B;
-(1.0+2.0*B) B;
B -(1.0+2.0*B);
A -(1.0+2*A);
A A;
-(1.0 + 2.0*A) A]
""" 7 point rule on triangle. Order 5 """
elseif Q == 7
A = -0.05971587178976995
B = -0.797426985353088
P1 = 4*0.066197076394253
P2 = 4*0.062969590272413
w = [36/80; P1; P1; P1; P2; P2; P2]
q = [-1.0/3.0 -1.0/3.0;
A A;
-(1.0+2.0*A) A;
A -(1.0+2.0*A);
B B;
-(1.0+2.0*B) B;
B -(1.0+2.0*B)]
""" 12 point rule on triangle. Order 6 """
elseif Q == 12
A = -0.8738219710169961
B = -0.50142650965818
C = -0.37929509793243005
D = -0.8937099003103679
P1 = 4*0.025422453185103
P2 = 4*0.058393137863189
P3 = 4*0.041425537809187
w = [P1; P1; P1; P2; P2; P2; P3; P3; P3; P3; P3; P3]
q = [A A;
-(1.0+2.0*A) A;
A -(1.0+2.0*A);
B B;
-(1.0+2.0*B) B;
B -(1.0+2.0*B);
C D;
D C;
-(1.0+C+D) C;
-(1.0+C+D) D;
C -(1.0+C+D);
D -(1.0+C+D)]
""" 13 point rule on triangle. Order 7 """
elseif Q == 13
w = [-0.299140088935364, 0.351230514866416, 0.106694471217676, 0.351230514866416, 0.106694471217676, 0.351230514866416, 0.106694471217676, 0.154227521780514, 0.154227521780514, 0.154227521780514, 0.154227521780514, 0.154227521780514, 0.154227521780514]
q = [-0.333333333333334 -0.333333333333334; -0.4793080678419201 -0.04138386431616009; -0.869739794195568 0.739479588391136; -0.04138386431616009 -0.4793080678419201; 0.739479588391136 -0.869739794195568; -0.4793080678419201 -0.4793080678419201; -0.869739794195568 -0.869739794195568; 0.27688837713962 -0.902619369149368; -0.374269007990252 -0.902619369149368; -0.902619369149368 -0.374269007990252; -0.902619369149368 0.27688837713962; -0.374269007990252 0.27688837713962; 0.27688837713962 -0.374269007990252]
""" 16 point rule on triangle. Order 8 """
elseif Q == 16
w = [0.288631215355574, 0.19018326853457, 0.206434741069436, 0.064916995246396, 0.19018326853457, 0.206434741069436, 0.064916995246396, 0.19018326853457, 0.206434741069436, 0.064916995246396, 0.05446062834887, 0.05446062834887, 0.05446062834887, 0.05446062834887, 0.05446062834887, 0.05446062834887]
q = [-0.333333333333334 -0.333333333333334; -0.081414823414554 -0.8371703531708921; -0.6588613844964799 0.3177227689929601; -0.8989055433659379 0.797811086731876; -0.8371703531708921 -0.08141482341455397; 0.31772276899296004 -0.6588613844964799; 0.797811086731876 -0.8989055433659381; -0.08141482341455397 -0.08141482341455397; -0.6588613844964799 -0.6588613844964799; -0.8989055433659381 -0.8989055433659379; 0.45698478591080804 -0.983210445180084; -0.473774340730724 -0.983210445180084; -0.983210445180084 -0.473774340730724; -0.983210445180084 0.45698478591080804; -0.473774340730724 0.45698478591080804; 0.45698478591080804 -0.473774340730724]
""" 19 point rule on triangle. Order 9 """
elseif Q == 19
w = [0.194271592565598, 0.062669400454278, 0.155655082009548, 0.15929547785442, 0.051155351317396, 0.062669400454278, 0.155655082009548, 0.15929547785442, 0.051155351317396, 0.062669400454278, 0.155655082009548, 0.15929547785442, 0.051155351317396, 0.086567078754578, 0.086567078754578, 0.086567078754578, 0.086567078754578, 0.086567078754578, 0.086567078754578]
q = [-0.333333333333334 -0.333333333333334; -0.020634961602525943 -0.95873007679495; -0.12582081701412795 -0.7483583659717459; -0.623592928761936 0.2471858575238699; -0.9105409732110963 0.8210819464221899; -0.95873007679495 -0.020634961602524038; -0.7483583659717459 -0.12582081701412584; 0.24718585752386993 -0.623592928761934; 0.8210819464221899 -0.9105409732110941; -0.020634961602524038 -0.020634961602526036; -0.12582081701412595 -0.12582081701412795; -0.623592928761934 -0.623592928761936; -0.9105409732110941 -0.9105409732110963; 0.4823971975689961 -0.9263231758905279; -0.5560740216784681 -0.9263231758905279; -0.9263231758905279 -0.5560740216784681; -0.9263231758905279 0.4823971975689961; -0.5560740216784681 0.48239719756899596; 0.48239719756899596 -0.5560740216784681]
""" 25 point rule on triangle. Order 10 """
elseif Q == 25
w = [0.181635980765508, 0.073451915512934, 0.090642118871056, 0.073451915512934, 0.090642118871056, 0.073451915512934, 0.090642118871056, 0.14551583369084, 0.056654485062114, 0.018843333927466, 0.14551583369084, 0.056654485062114, 0.018843333927466, 0.14551583369084, 0.056654485062114, 0.018843333927466, 0.14551583369084, 0.056654485062114, 0.018843333927466, 0.14551583369084, 0.056654485062114, 0.018843333927466, 0.14551583369084, 0.056654485062114, 0.018843333927466]
q = [-0.333333333333334 -0.333333333333334; -0.028844733232684 -0.94231053353463; -0.781036849029926 0.562073698059852; -0.94231053353463 -0.028844733232685993; 0.562073698059852 -0.781036849029926; -0.028844733232685993 -0.028844733232683994; -0.781036849029926 -0.781036849029926; 0.10070588364199803 -0.7165855611702401; 0.45664780919482206 -0.949992930474628; 0.8473118671750018 -0.980918369199402; -0.384120322471758 -0.7165855611702401; -0.506654878720194 -0.949992930474628; -0.8663934979756001 -0.9809183691994019; -0.7165855611702401 -0.384120322471758; -0.949992930474628 -0.5066548787201941; -0.9809183691994019 -0.8663934979756001; -0.7165855611702401 0.10070588364199806; -0.949992930474628 0.45664780919482206; -0.9809183691994019 0.847311867175002; -0.384120322471758 0.10070588364199806; -0.5066548787201941 0.456647809194822; -0.8663934979756001 0.847311867175002; 0.10070588364199806 -0.384120322471758; 0.456647809194822 -0.5066548787201941; 0.847311867175002 -0.8663934979756001]
end
return w, q
end