1
1
2
2
module Quadratures
3
3
4
- import GaussQuadrature
4
+ import FastGaussQuadrature
5
5
import StaticArrays: SVector, SMatrix, MMatrix
6
6
import LinearAlgebra: Diagonal
7
7
@@ -53,6 +53,8 @@ function quadrature_points end
53
53
GLL{Nq}()
54
54
55
55
Gauss-Legendre-Lobatto quadrature using `Nq` quadrature points.
56
+
57
+ https://mathworld.wolfram.com/LobattoQuadrature.html
56
58
"""
57
59
struct GLL{Nq} <: QuadratureStyle{Nq} end
58
60
@@ -61,8 +63,8 @@ Base.show(io::IO, ::GLL{Nq}) where {Nq} =
61
63
62
64
unique_degrees_of_freedom (:: GLL{Nq} ) where {Nq} = Nq - 1
63
65
@generated function quadrature_points (:: Type{FT} , :: GLL{Nq} ) where {FT, Nq}
64
- points, weights = GaussQuadrature . legendre (FT, Nq, GaussQuadrature . both )
65
- :($ (SVector {Nq} (points)), $ (SVector {Nq} (weights)))
66
+ points, weights = FastGaussQuadrature . gausslobatto (Nq )
67
+ :($ (SVector {Nq, FT } (points)), $ (SVector {Nq, FT } (weights)))
66
68
end
67
69
68
70
"""
@@ -77,8 +79,8 @@ Base.show(io::IO, ::GL{Nq}) where {Nq} =
77
79
78
80
unique_degrees_of_freedom (:: GL{Nq} ) where {Nq} = Nq
79
81
@generated function quadrature_points (:: Type{FT} , :: GL{Nq} ) where {FT, Nq}
80
- points, weights = GaussQuadrature . legendre (FT, Nq, GaussQuadrature . neither )
81
- :($ (SVector {Nq} (points)), $ (SVector {Nq} (weights)))
82
+ points, weights = FastGaussQuadrature . gausslegendre (Nq )
83
+ :($ (SVector {Nq, FT } (points)), $ (SVector {Nq, FT } (weights)))
82
84
end
83
85
84
86
"""
220
222
quadrature_points (FT, quadfrom ())[1 ],
221
223
)
222
224
end
223
-
225
+ #=
224
226
"""
225
227
V = orthonormal_poly(points, quad)
226
228
@@ -247,7 +249,7 @@ function spectral_filter_matrix(
247
249
V = orthonormal_poly(points, quad)
248
250
return V * Diagonal(Σ) / V
249
251
end
250
-
252
+ =#
251
253
function cutoff_filter_matrix (
252
254
:: Type{FT} ,
253
255
quad:: GLL{Nq} ,
0 commit comments