Files
JuliaFEM.jl/src/assemblers/caches
Jukka Aho a49de72aaf feat(src): add material_cache.jl
src/assemblers/caches/material_cache.jl | 421 ++++++++++++++++++++++++++++++++  1 file changed, 421 insertions(+)
2026-05-09 16:30:30 +03:00
..
2026-05-09 16:30:30 +03:00
2026-05-09 16:30:29 +03:00

src/assemblers/caches/

Pre-allocated per-element scratch and global COO/CSC caches reused by every assembly strategy. Keeping them in one place makes it easy to see what is allocated up-front and what is consumed by the hot loops.

Files

  • geometry_cache.jlGeometryCache. Per-element shape values, derivatives, and Jacobian data sized for one quadrature rule. Parametric on storage so the same struct works heap-owned (element-based assemblers) or as a view into batched SoA storage (DOF-based assembler).
  • element_cache.jlElementCache. Assembly-time per-element scratch (local stiffness, force, dof index buffers).
  • material_cache.jlAssemblyMaterialWorkspace plus the create_material_cache helper. Holds the per-IP material state buffers (stress, tangent, history) used by the kernels.
  • coo_cache.jlCOOCache, the global I/J/V triplet workspace used by the element-based assembler.

The hot-path invariant for all of these is zero allocation per element on a steady-state assemble. The regression test for that is test/assemblers/test_dof_based_zero_alloc.jl.