mirror of
https://github.com/JuliaFEM/JuliaFEM.jl.git
synced 2026-09-01 00:36:24 +00:00
1539585964
The core fix that eliminates all kernel allocations.
Key change:
- ElementCache{T,B} → ElementCache{T,B,IPS}
- ips::Any → ips::IPS (type parameter)
Root cause identified:
- ips::Any caused type instability (192 bytes allocated)
- Julia compiler couldn't determine concrete type at compile time
- Required runtime type checking and boxing
- Cascaded to all downstream variables
Solution impact:
- Compiler now sees concrete type: NTuple{8, IntegrationPoint{3}}
- Zero runtime type checks
- Zero boxing/unboxing
- Zero allocations ✓
Additional improvements:
- Pre-compute topology, basis, ips during cache creation
- Add X_buffer, K_blocks, u_buffer for blocked tensor assembly
- All workspace arrays pre-allocated for zero-allocation assembly
Result: 192 bytes → 0 bytes (100% reduction)
Verified by:
- @code_warntype shows ips::NTuple{8, IntegrationPoint{3}}
- @allocated shows 0 bytes for compute_element_stiffness!()
- All kernel interface methods: 0 bytes ✓