fix(integration): Fix type inference in integration_points conversion

Modified src/integration/gauss.jl to fix IntegrationPoint creation:
- Changed from generator expression to ntuple for proper type inference
- Collect quad_data first (was zip iterator, cannot be indexed)
- Remove explicit type parameter {D} - let Julia infer from arguments
- Fixes type stability issue in integration point generation
- Maintains zero-allocation design with tuple return
This commit is contained in:
Jukka Aho
2025-11-12 00:54:35 +02:00
parent 1e59eb1bbc
commit 57ca301b86
+8 -2
View File
@@ -230,8 +230,14 @@ function integration_points(scheme::Gauss{N}, topology::T) where {N,T<:AbstractT
# Get points from quadrature module (src/quadrature/)
quad_data = get_quadrature_points(Val{rule_name})
# Convert to tuple of IntegrationPoints (zero allocation)
return tuple((IntegrationPoint{D}(point, weight) for (weight, point) in quad_data)...)
# Convert to tuple of IntegrationPoints
# Collect first since quad_data is a zip iterator (cannot be indexed)
data_vec = collect(quad_data)
result = ntuple(length(data_vec)) do i
weight, point = data_vec[i]
IntegrationPoint(point, weight) # Type inference from arguments
end
return result
end
# Number of integration points