Skip to content

Commit 4b4c349

Browse files
Move from using GaussQuadrature to FastGaussQuadrature.jl
1 parent 9f4a732 commit 4b4c349

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
1010
ClimaComms = "3a4d1b5c-c61d-41fd-a00a-5873ba7a1b0d"
1111
CubedSphere = "7445602f-e544-4518-8976-18f8e8ae6cdb"
1212
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
13+
FastGaussQuadrature = "442a2c76-b920-505d-bb47-c5924d526838"
1314
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
14-
GaussQuadrature = "d54b0c1a-921d-58e0-8e36-89d8069c0969"
1515
GilbertCurves = "88fa7841-ef32-4516-bb70-c6ec135699d9"
1616
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
1717
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
@@ -51,8 +51,8 @@ CubedSphere = "0.2, 0.3"
5151
DataStructures = "0.18.13"
5252
Dates = "1"
5353
FastBroadcast = "0.3.1"
54+
FastGaussQuadrature = "1.0.2"
5455
ForwardDiff = "0.10.15"
55-
GaussQuadrature = "0.5.8"
5656
GilbertCurves = "0.1"
5757
HDF5 = "0.16.16, 0.17"
5858
InteractiveUtils = "1"

src/Quadratures/Quadratures.jl

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
module Quadratures
33

4-
import GaussQuadrature
4+
import FastGaussQuadrature
55
import StaticArrays: SVector, SMatrix, MMatrix
66
import LinearAlgebra: Diagonal
77

@@ -53,6 +53,8 @@ function quadrature_points end
5353
GLL{Nq}()
5454
5555
Gauss-Legendre-Lobatto quadrature using `Nq` quadrature points.
56+
57+
https://mathworld.wolfram.com/LobattoQuadrature.html
5658
"""
5759
struct GLL{Nq} <: QuadratureStyle{Nq} end
5860

@@ -61,8 +63,8 @@ Base.show(io::IO, ::GLL{Nq}) where {Nq} =
6163

6264
unique_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)))
6668
end
6769

6870
"""
@@ -77,8 +79,8 @@ Base.show(io::IO, ::GL{Nq}) where {Nq} =
7779

7880
unique_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)))
8284
end
8385

8486
"""
@@ -220,7 +222,7 @@ end
220222
quadrature_points(FT, quadfrom())[1],
221223
)
222224
end
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
249251
end
250-
252+
=#
251253
function cutoff_filter_matrix(
252254
::Type{FT},
253255
quad::GLL{Nq},

0 commit comments

Comments
 (0)