Files
JuliaFEM.jl/docs
Jukka Aho 6a8f8adc1f docs: Benchmark manual vs AD derivatives for Tet10
RESEARCH QUESTION: Should JuliaFEM use hand-calculated derivatives or AD?

Created comprehensive benchmark comparing:
- Manual: Hand-calculated derivatives (traditional FEM)
- AD: Tensors.jl gradient() (automatic differentiation)

RESULTS (AMD Ryzen 9, Julia 1.12.1):
- Manual: 8.7 ns, 0 allocations
- AD:     268.1 ns, 0 allocations
- AD is 30× SLOWER than manual

KEY FINDINGS:
 Both achieve zero allocations (Tensors.jl is well-optimized)
 AD has 30× compute overhead from dual number arithmetic
⚠️  In assembly loops: millions of calls = 10+ seconds extra per solve

RECOMMENDATION:
- Keep manual derivatives for common elements (Tet10, Hex8, Quad4, etc.)
- Use AD for prototyping and rare elements
- Unit test manual vs AD to catch errors
- Future: Generate derivatives symbolically (Symbolics.jl)

WHY NOT AD EVERYWHERE?
Assembly is hottest path in FEM. 30× overhead = unacceptable for
production code. Users will notice the performance difference.

WHY NOT ABANDON AD?
- Excellent for prototyping
- Required for exotic bases (NURBS)
- Perfect for unit testing manual derivatives
- Zero allocations impressive

Files:
- benchmarks/tet10_derivatives_benchmark.jl (runnable benchmark)
- docs/benchmarks/shape_function_derivatives_ad_vs_manual.md (analysis)

Dependencies added: BenchmarkTools

This answers the research question definitively with data.
2025-11-09 03:41:47 +02:00
..
2018-04-23 15:37:03 +03:00
2017-08-23 15:53:01 +03:00
2017-08-05 12:08:46 +03:00
2015-07-06 18:16:04 +03:00
2015-08-25 21:32:43 +03:00
2015-07-06 18:16:04 +03:00
2015-11-12 07:17:03 +02:00
2015-07-08 23:47:29 +03:00
2019-04-08 21:35:13 +03:00
2019-04-08 21:35:13 +03:00