From ce82526878af44c44e76789d72bedb812101c372 Mon Sep 17 00:00:00 2001 From: Mike Ingold Date: Mon, 2 Dec 2024 14:19:03 -0500 Subject: [PATCH] Absorb _gausslegendre into only remaining GaussLegendre method --- src/integral.jl | 10 ++++++---- src/utils.jl | 11 ----------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/integral.jl b/src/integral.jl index 2535e21b..2dbb0cdd 100644 --- a/src/integral.jl +++ b/src/integral.jl @@ -74,10 +74,12 @@ function _integral( ) where {DM <: DifferentiationMethod, T <: AbstractFloat} N = Meshes.paramdim(geometry) - # Get Gauss-Legendre nodes and weights for a region [-1,1]^N - xs, ws = _gausslegendre(FP, rule.n) - weights = Iterators.product(ntuple(Returns(ws), N)...) - nodes = Iterators.product(ntuple(Returns(xs), N)...) + # Get Gauss-Legendre nodes and weights of type FP for a region [-1,1]ᴺ + xs, ws = FastGaussQuadrature.gausslegendre(N) + xsT = Iterator.map(FP, xs) + wsT = Iterator.map(FP, ws) + weights = Iterators.product(ntuple(Returns(wsT), N)...) + nodes = Iterators.product(ntuple(Returns(xsT), N)...) # Domain transformation: x [-1,1] ↦ t [0,1] t(x) = (1 // 2) * x + (1 // 2) diff --git a/src/utils.jl b/src/utils.jl index 5ac0d03c..954dcf08 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -26,17 +26,6 @@ _default_diff_method(g::G) where {G <: Geometry} = _default_diff_method(G) # Numerical Tools ################################################################################ -# Calculate Gauss-Legendre nodes/weights and convert to type T -""" - _gausslegendre(T, n) - -Return FastGaussQuadrature.gausslegendre(n) in type T. -""" -function _gausslegendre(T, n) - xs, ws = FastGaussQuadrature.gausslegendre(n) - return T.(xs), T.(ws) -end - """ _KVector(v::Meshes.Vec) -> Unitful.Quantity{CliffordNumbers.KVector}