Skip to content

Commit ce7e6de

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

File tree

4 files changed

+21
-19
lines changed

4 files changed

+21
-19
lines changed

.buildkite/Manifest.toml

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

33
julia_version = "1.10.8"
44
manifest_format = "2.0"
5-
project_hash = "6ab89829ea190189b0319a6f8e22b3515e5283c2"
5+
project_hash = "9786ec51b6b23f66f725f67233ccda530759f405"
66

77
[[deps.ADTypes]]
88
git-tree-sha1 = "e2478490447631aedba0823d4d7a80b2cc8cdb32"
@@ -327,10 +327,10 @@ weakdeps = ["CUDA", "MPI"]
327327
ClimaCommsMPIExt = "MPI"
328328

329329
[[deps.ClimaCore]]
330-
deps = ["Adapt", "BandedMatrices", "BlockArrays", "ClimaComms", "CubedSphere", "DataStructures", "ForwardDiff", "GaussQuadrature", "GilbertCurves", "HDF5", "InteractiveUtils", "IntervalSets", "KrylovKit", "LinearAlgebra", "MultiBroadcastFusion", "NVTX", "PkgVersion", "RecursiveArrayTools", "RootSolvers", "SparseArrays", "StaticArrays", "Statistics", "UnrolledUtilities"]
330+
deps = ["Adapt", "BandedMatrices", "BlockArrays", "ClimaComms", "CubedSphere", "DataStructures", "FastGaussQuadrature", "ForwardDiff", "GilbertCurves", "HDF5", "InteractiveUtils", "IntervalSets", "KrylovKit", "LinearAlgebra", "MultiBroadcastFusion", "NVTX", "PkgVersion", "RecursiveArrayTools", "RootSolvers", "SparseArrays", "StaticArrays", "Statistics", "UnrolledUtilities"]
331331
path = ".."
332332
uuid = "d414da3d-4745-48bb-8d80-42e94e092884"
333-
version = "0.14.27"
333+
version = "0.14.29"
334334
weakdeps = ["CUDA", "Krylov"]
335335

336336
[deps.ClimaCore.extensions]
@@ -744,6 +744,12 @@ git-tree-sha1 = "acebe244d53ee1b461970f8910c235b259e772ef"
744744
uuid = "9aa1b823-49e4-5ca5-8b0f-3971ec8bab6a"
745745
version = "0.3.2"
746746

747+
[[deps.FastGaussQuadrature]]
748+
deps = ["LinearAlgebra", "SpecialFunctions", "StaticArrays"]
749+
git-tree-sha1 = "fd923962364b645f3719855c88f7074413a6ad92"
750+
uuid = "442a2c76-b920-505d-bb47-c5924d526838"
751+
version = "1.0.2"
752+
747753
[[deps.FastPower]]
748754
git-tree-sha1 = "58c3431137131577a7c379d00fea00be524338fb"
749755
uuid = "a4df4552-cc26-4903-aec0-212e50a0e84b"
@@ -896,12 +902,6 @@ git-tree-sha1 = "9cb62849057df859575fc1dda1e91b82f8609709"
896902
uuid = "d2c73de3-f751-5644-a686-071e5b155ba9"
897903
version = "0.73.13+0"
898904

899-
[[deps.GaussQuadrature]]
900-
deps = ["SpecialFunctions"]
901-
git-tree-sha1 = "eb6f1f48aa994f3018cbd029a17863c6535a266d"
902-
uuid = "d54b0c1a-921d-58e0-8e36-89d8069c0969"
903-
version = "0.5.8"
904-
905905
[[deps.Gettext_jll]]
906906
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Libiconv_jll", "Pkg", "XML2_jll"]
907907
git-tree-sha1 = "9b02998aba7bf074d14de89f9d37ca24a1a0b046"

.buildkite/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
2020
DiffEqCallbacks = "459566f4-90b8-5000-8ac3-15dfb0a30def"
2121
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
2222
FastBroadcast = "7034ab61-46d4-4ed7-9d0f-46aef9175898"
23+
FastGaussQuadrature = "442a2c76-b920-505d-bb47-c5924d526838"
2324
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
24-
GaussQuadrature = "d54b0c1a-921d-58e0-8e36-89d8069c0969"
2525
GilbertCurves = "88fa7841-ef32-4516-bb70-c6ec135699d9"
2626
IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953"
2727
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"

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)