Skip to content

Commit

Permalink
Absorb _gausslegendre into only remaining GaussLegendre method
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeingold committed Dec 2, 2024
1 parent d5bc58f commit ce82526
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
10 changes: 6 additions & 4 deletions src/integral.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 0 additions & 11 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit ce82526

Please sign in to comment.