Matrix-Free Methods for Finite-Strain Elasticity: Automatic Code Generation with No Performance Overhead
Michał Wichrowski, Mohsen Rezaee-Hajidehi, Jože Korelc, Martin Kronbichler, Stanisław Stupkiewicz
TL;DR
This work addresses the computational bottleneck of matrix-free tangent evaluations in finite-strain elasticity by generating quadrature-point kernels with AceGen through automatic differentiation. It systematically compares on-the-fly and cached (partial-assembly) strategies and demonstrates that AceGen-generated code can outperform traditional hand-written implementations while incurring no overhead, for both compressible neo-Hookean and isochoric–volumetric split variants. A seed-based AD approach eliminates the need to form the full tangent operator, and caching of the fourth-order tensor or related quantities further boosts performance, especially in 2D, with matrix-free methods surpassing sparse-matrix solvers by large factors at higher polynomial degrees. The findings underscore the practical impact of automatic code generation for matrix-free solvers in nonlinear elasticity on modern HPC hardware and suggest avenues for refining smoothers and geometry-handling (e.g., cutFEM, multigrid variants) to tackle more complex models and near-incompressibility.
Abstract
This study explores matrix-free tangent evaluations in finite-strain elasticity with the use of automatically-generated code for the quadrature-point level calculations. The code generation is done via automatic differentiation (AD) with AceGen. We compare hand-written and AD-generated codes under two computing strategies: on-the-fly evaluation and caching intermediate results. The comparison reveals that the AD-generated code achieves superior performance in matrix-free computations.
