11
22module Quadratures
33
4- import GaussQuadrature
4+ import FastGaussQuadrature
55import StaticArrays: SVector, SMatrix, MMatrix
66import LinearAlgebra: Diagonal
77
@@ -53,6 +53,8 @@ function quadrature_points end
5353 GLL{Nq}()
5454
5555Gauss-Legendre-Lobatto quadrature using `Nq` quadrature points.
56+
57+ https://mathworld.wolfram.com/LobattoQuadrature.html
5658"""
5759struct GLL{Nq} <: QuadratureStyle{Nq} end
5860
@@ -61,8 +63,8 @@ Base.show(io::IO, ::GLL{Nq}) where {Nq} =
6163
6264unique_degrees_of_freedom (:: GLL{Nq} ) where {Nq} = Nq - 1
6365@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)))
6668end
6769
6870"""
@@ -77,8 +79,8 @@ Base.show(io::IO, ::GL{Nq}) where {Nq} =
7779
7880unique_degrees_of_freedom (:: GL{Nq} ) where {Nq} = Nq
7981@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)))
8284end
8385
8486"""
220222 quadrature_points (FT, quadfrom ())[1 ],
221223 )
222224end
223-
225+ #=
224226"""
225227 V = orthonormal_poly(points, quad)
226228
@@ -247,7 +249,7 @@ function spectral_filter_matrix(
247249 V = orthonormal_poly(points, quad)
248250 return V * Diagonal(Σ) / V
249251end
250-
252+ =#
251253function cutoff_filter_matrix (
252254 :: Type{FT} ,
253255 quad:: GLL{Nq} ,
0 commit comments