Commit Graph

4 Commits

Author SHA1 Message Date
Jukka Aho d428686658 refactor(domains): refresh continuum geometry cache fill for shape functions
Align `update_geometry_cache!` with element caches that carry continuum-specific
data and surface scalar basis values needed for mass kernels.

- Remove unused `kernel::AbstractKernel` parameter and narrow `element_cache` to
  `ContinuumElementCache`.
- Evaluate `get_basis_functions` each IP, storing `N_data` beside `∇N_data`.
- Rewrite docstring around concrete fields (`X`, `N_data`, `∇N_data`, `detJ_w`)
  and zero-allocation guarantees.
2026-05-09 16:50:49 +03:00
Jukka Aho fb770644c4 refactor(domains): optimize update_geometry_cache! for zero-allocation
Optimize update_geometry_cache! to eliminate iterator allocations and
update to use coords field.

- Add @inline to update_geometry_cache! for better inlining
- Change enumerate loop to indexed loop to avoid iterator allocation
- Add @inbounds annotation for bounds-check elimination
- Change ip.ξ to ip.coords to use new QuadraturePoint API
2025-12-12 23:36:21 +02:00
Jukka Aho 9148ef223b refactor(domains): Remove Vec{3} conversion in update_geometry_cache
- Changed 'ξ = Vec{3}(ip.ξ)' to 'ξ = ip.ξ'
- No conversion needed since ip.ξ is now already Vec{3}
2025-11-20 17:55:23 +02:00
Jukka Aho 40816c3b3c feat(continuum): Add update_geometry_cache! with zero-allocation ntuple fix
New file: src/domains/continuum/update_geometry_cache.jl (239 lines)

Features:
- update_geometry_cache!(geometry_cache, mesh, nodes, basis)
- Computes shape function gradients at integration points
- Computes Jacobian determinants with quadrature weights
- Part of three-phase cache update pattern

Phase 2 of assembly (Geometry preprocessing):
- Extract element node coordinates
- Evaluate basis function gradients ∇N at each integration point
- Compute Jacobian matrix J and determinant det(J)
- Multiply det(J) × weight → detJ_w for integration
- Transform ∇N from parent to physical space

This is the SECOND of three cache updates called per element:
1. update_element_cache! (DOF mapping)
2. update_geometry_cache! (Jacobian, gradients) ← THIS FILE
3. update_material_cache! (stress, tangent)
2025-11-20 16:56:40 +02:00