mirror of
https://github.com/JuliaFEM/JuliaFEM.jl.git
synced 2026-09-23 19:06:15 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user