-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGetGLL.py
123 lines (109 loc) · 9.34 KB
/
GetGLL.py
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
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def GetGLL(N):
"""
Returns GLL (Gauss Lobato Legendre module with collocation points and
weights)
"""
# Initialization of integration weights and collocation points
# [xi, weights] = gll(N)
# Values taken from Diploma Thesis Bernhard Schuberth
if N == 2:
xi = [-1.0, 0.0, 1.0]
w = [0.33333333, 1.33333333, 0.33333333]
elif N == 3:
xi = [-1.0, -0.447213595499957, 0.447213595499957, 1.0]
w = [0.1666666667, 0.833333333, 0.833333333, 0.1666666666]
elif N == 4:
xi = [-1.0, -0.6546536707079772, 0.0, 0.6546536707079772, 1.0]
w = [0.1, 0.544444444, 0.711111111, 0.544444444, 0.1]
elif N == 5:
xi = [-1.0, -0.7650553239294647, -0.285231516480645, 0.285231516480645,
0.7650553239294647, 1.0]
w = [0.0666666666666667, 0.3784749562978470,
0.5548583770354862, 0.5548583770354862, 0.3784749562978470,
0.0666666666666667]
elif N == 6:
xi = [-1.0, -0.8302238962785670, -0.4688487934707142, 0.0,
0.4688487934707142, 0.8302238962785670, 1.0]
w = [0.0476190476190476, 0.2768260473615659, 0.4317453812098627,
0.4876190476190476, 0.4317453812098627, 0.2768260473615659,
0.0476190476190476]
elif N == 7:
xi = [-1.0, -0.8717401485096066, -0.5917001814331423,
-0.2092992179024789, 0.2092992179024789, 0.5917001814331423,
0.8717401485096066, 1.0]
w = [0.0357142857142857, 0.2107042271435061, 0.3411226924835044,
0.4124587946587038, 0.4124587946587038, 0.3411226924835044,
0.2107042271435061, 0.0357142857142857]
elif N == 8:
xi = [-1.0, -0.8997579954114602, -0.6771862795107377,
-0.3631174638261782, 0.0, 0.3631174638261782,
0.6771862795107377, 0.8997579954114602, 1.0]
w = [0.0277777777777778, 0.1654953615608055, 0.2745387125001617,
0.3464285109730463, 0.3715192743764172, 0.3464285109730463,
0.2745387125001617, 0.1654953615608055, 0.0277777777777778]
elif N == 9:
xi = [-1.0, -0.9195339081664589, -0.7387738651055050,
-0.4779249498104445, -0.1652789576663870, 0.1652789576663870,
0.4779249498104445, 0.7387738651055050, 0.9195339081664589, 1.0]
w = [0.0222222222222222, 0.1333059908510701, 0.2248893420631264,
0.2920426836796838, 0.3275397611838976, 0.3275397611838976,
0.2920426836796838, 0.2248893420631264, 0.1333059908510701,
0.0222222222222222]
elif N == 10:
xi = [-1.0, -0.9340014304080592, -0.7844834736631444,
-0.5652353269962050, -0.2957581355869394, 0.0,
0.2957581355869394, 0.5652353269962050, 0.7844834736631444,
0.9340014304080592, 1.0]
w = [0.0181818181818182, 0.1096122732669949, 0.1871698817803052,
0.2480481042640284, 0.2868791247790080, 0.3002175954556907,
0.2868791247790080, 0.2480481042640284, 0.1871698817803052,
0.1096122732669949, 0.0181818181818182]
elif N == 11:
xi = [-1.0, -0.9448992722228822, -0.8192793216440067,
-0.6328761530318606, -0.3995309409653489, -0.1365529328549276,
0.1365529328549276, 0.3995309409653489, 0.6328761530318606,
0.8192793216440067, 0.9448992722228822, 1.0]
w = [0.0151515151515152, 0.0916845174131962, 0.1579747055643701,
0.2125084177610211, 0.2512756031992013, 0.2714052409106962,
0.2714052409106962, 0.2512756031992013, 0.2125084177610211,
0.1579747055643701, 0.0916845174131962, 0.0151515151515152]
elif N == 12:
xi = [-1.0, -0.9533098466421639, -0.8463475646518723,
-0.6861884690817575, -0.4829098210913362, -0.2492869301062400,
0.0, 0.2492869301062400, 0.4829098210913362,
0.6861884690817575, 0.8463475646518723, 0.9533098466421639,
1.0]
w = [0.0128205128205128, 0.0778016867468189, 0.1349819266896083,
0.1836468652035501, 0.2207677935661101, 0.2440157903066763,
0.2519308493334467, 0.2440157903066763, 0.2207677935661101,
0.1836468652035501, 0.1349819266896083, 0.0778016867468189,
0.0128205128205128]
elif N == 13:
xi = [-1.00, -0.9599350452672609, -0.8678010538303472, -0.7288685990913262, -0.5506394029286471, -0.3427240133427129, -0.1163318688837039, 0.1163318688837039, 0.3427240133427129, 0.5506394029286471, 0.7288685990913262, 0.8678010538303472, 0.9599350452672609, 1.00]
w = [0.0109890109890110, 0.0668372844976813, 0.1165866558987116, 0.1600218517629522, 0.1948261493734161, 0.2191262530097707, 0.2316127944684571, 0.2316127944684571, 0.2191262530097707, 0.1948261493734161, 0.1600218517629522, 0.1165866558987116, 0.0668372844976813, 0.0109890109890110]
elif N == 14:
xi = [-1.00, -0.9652459265038386, -0.8850820442229763, -0.7635196899518152, -0.6062532054698457, -0.4206380547136725, -0.2153539553637942, 0.00, 0.2153539553637942, 0.4206380547136725, 0.6062532054698457, 0.7635196899518152, 0.8850820442229763, 0.9652459265038386, 1.00]
w = [0.0095238095238095, 0.0580298930286012, 0.1016600703257181, 0.1405116998024281, 0.1727896472536010, 0.1969872359646133, 0.2119735859268209, 0.2170481163488156, 0.2119735859268209, 0.1969872359646133, 0.1727896472536010, 0.1405116998024281, 0.1016600703257181, 0.0580298930286012, 0.0095238095238095]
elif N == 15:
xi = [-1.00, -0.9695680462702179, -0.8992005330934720, -0.7920082918618151, -0.6523887028824931, -0.4860594218871376, -0.2998304689007632, -0.1013262735219494, 0.1013262735219494, 0.2998304689007632, 0.4860594218871376, 0.6523887028824931, 0.7920082918618151, 0.8992005330934720, 0.9695680462702179, 1.00]
w = [0.0083333333333333, 0.0508503610059199, 0.0893936973259309, 0.1242553821325140, 0.1540269808071643, 0.1774919133917041, 0.1936900238252035, 0.2019583081782299, 0.2019583081782299, 0.1936900238252035, 0.1774919133917041, 0.1540269808071643, 0.1242553821325140, 0.0893936973259309, 0.0508503610059199, 0.0083333333333333]
elif N == 16:
xi = [-1.00, -0.9731321766314183, -0.9108799959155736, -0.8156962512217704, -0.6910289806276847, -0.5413853993301015, -0.3721744335654771, -0.1895119735183174, 0.00, 0.1895119735183174, 0.3721744335654771, 0.5413853993301015, 0.6910289806276847, 0.8156962512217704, 0.9108799959155736, 0.9731321766314183, 1.00]
w = [0.0073529411764706, 0.0449219405432542, 0.0791982705036872, 0.1105929090070282, 0.1379877462019266, 0.1603946619976216, 0.1770042535156579, 0.1872163396776193, 0.1906618747534695, 0.1872163396776193, 0.1770042535156579, 0.1603946619976216, 0.1379877462019266, 0.1105929090070282, 0.0791982705036872, 0.0449219405432542, 0.0073529411764706]
elif N == 17:
xi = [-1.00, -0.9761055574121986, -0.9206491853475339, -0.8355935352180902, -0.7236793292832427, -0.5885048343186617, -0.4344150369121240, -0.2663626528782810, -0.0897490934846521, 0.0897490934846521, 0.2663626528782810, 0.4344150369121240, 0.5885048343186617, 0.7236793292832427, 0.8355935352180902, 0.9206491853475339, 0.9761055574121986, 1.00]
w = [0.0065359477124183, 0.0399706288109141, 0.0706371668856337, 0.0990162717175028, 0.1242105331329671, 0.1454119615738022, 0.1619395172376025, 0.1732621094894562, 0.1790158634397031, 0.1790158634397031, 0.1732621094894562, 0.1619395172376025, 0.1454119615738022, 0.1242105331329671, 0.0990162717175028, 0.0706371668856337, 0.0399706288109141, 0.0065359477124183]
elif N == 18:
xi = [-1.00, -0.9786117662220801, -0.9289015281525862, -0.8524605777966461, -0.7514942025526130, -0.6289081372652205, -0.4882292856807135, -0.3335048478244986, -0.1691860234092816, 0.00, 0.1691860234092816, 0.3335048478244986, 0.4882292856807135, 0.6289081372652205, 0.7514942025526130, 0.8524605777966461, 0.9289015281525862, 0.9786117662220801, 1.00]
w = [0.0058479532163743, 0.0357933651861765, 0.0633818917626297, 0.0891317570992071, 0.1123153414773050, 0.1322672804487508, 0.1484139425959389, 0.1602909240440612, 0.1675565845271429, 0.1700019192848272, 0.1675565845271429, 0.1602909240440612, 0.1484139425959389, 0.1322672804487508, 0.1123153414773050, 0.0891317570992071, 0.0633818917626297, 0.0357933651861765, 0.0058479532163743]
elif N == 19:
xi = [-1.00, -0.9807437048939142, -0.9359344988126654, -0.8668779780899502, -0.7753682609520559, -0.6637764022903113, -0.5349928640318863, -0.3923531837139093, -0.2395517059229865, -0.0805459372388218, 0.0805459372388218, 0.2395517059229865, 0.3923531837139093, 0.5349928640318863, 0.6637764022903113, 0.7753682609520559, 0.8668779780899502, 0.9359344988126654, 0.9807437048939142, 1.00]
w = [0.0052631578947368, 0.0322371231884889, 0.0571818021275669, 0.0806317639961196, 0.1019914996994508, 0.1207092276286747, 0.1363004823587242, 0.1483615540709168, 0.1565801026474755, 0.1607432863878457, 0.1607432863878457, 0.1565801026474755, 0.1483615540709168, 0.1363004823587242, 0.1207092276286747, 0.1019914996994508, 0.0806317639961196, 0.0571818021275669, 0.0322371231884889, 0.0052631578947368]
else:
raise NotImplementedError
return xi, w