CS Paper Radar

Extensible Programmatic Specification of Finite Element Methods

Theadora Fields Collin, Oded Stein, Gilbert Bernstein, Saman Amarasinghe

cs.MS cs.GRcs.PL ·submitted 2026-11-01 01:50 UTC · v1

Abstract

Finite element methods (FEMs) are a powerful and ubiquitous tool for solving engineering problems. Experimenting with different finite elements can improve the quality and efficiency of solutions. In some cases, the wrong (but nonetheless most common) choice of finite element will produce solutions which converge to the wrong answer regardless of mesh resolution. However, in practice, the choice of finite element is not explored due to the complexity of re-deriving and re-implementing finite element methods. Trying a new finite element is challenging because practitioners must manually deduce formulas to use these elements and implement them within a potentially complex system. We address this problem by introducing ElementForge, a finite element system that is parametric over the literate mathematical specification of a finite element in a domain-specific language (DSL). The ElementForge compiler reasons about tensor spaces, tensors, and tensor bases from first principles to derive implementations of finite elements. The ElementForge compiler is able to automatically derive implementations of finite elements previously only derived by hand. Further, ElementForge minimally couples several key mathematical concepts, mainly tensor fields, mesh topologies, sparse tensors, and assembled finite element operators, to produce a complete finite element system that is parametric over the choice of element. Consequently, the elements derived by the compiler can be applied parametrically to new meshes, PDEs, and boundary conditions. We evaluate our system by implementing several simulations with different finite elements, demonstrating that our system can explore tradeoffs in generality, accuracy, speed, and representational complexity. For example, we are able to implement the Morley, Bell, Argyris, and Hermite like elements with less than 50 lines of code and use them all in a single simulation.

Comment
52 pages, 25 figures, including appendices

Closest papers

Nearest neighbours by meaning across the whole index.

Axion: A differentiable, GPU-native finite element framework,demonstrated on phase-field fracture

cs.CE ·2026-11-18 ·Wei Wang, Meenu Krishnan U., Somdatta Goswami
benchmarkcode/data similarity 0.65
Abstract · 35 pages, 9 figures

We introduce Axion (Autodifferentiable, XLA-compiled, Implicit, On-device Numerics), a differentiable, GPU-native finite element framework written in JAX. The element kernels, Newton and Krylov iterations, bound-constrained updates, staggered coupling of fields, and the loop over load increments are expressed as a single program that is just-in-time compiled and executed on the GPU without host intervention. Consistent tangent operators are obtained by forward-mode automatic differentiation of the element residual, and derivatives of the discrete solution with respect to model parameters are obtained by differentiating the same program. Global operators are applied element by element without assembling a sparse matrix, octree mesh refinement is performed within fixed-size arrays, and a cell-based domain decomposition runs the same program on several GPUs. Phase-field fracture is implemented as the first module because it combines fine mesh resolution, bound-constrained damage, and repeated nonlinear solves over a loading history, which together make it computationally expensive. On two- and three-dimensional single-edge-notched tension benchmarks, a uniformly refined Axion computation completes faster than the corresponding adaptive FEniCSx computation. At identical discretization, the two-dimensional benchmark runs 37.9 times faster on one GPU than a FEniCSx implementation on one CPU. Strong and weak scaling efficiencies on four GPUs are 92% and 96%, respectively. Large-scale demonstrations include hydraulic fracture in a poroelastic medium (0.38M degrees of freedom), fracture of a multi-material premolar under contact loading (0.69M degrees of freedom), and a concrete gravity dam (96M degrees of freedom) on a single GPU. The implementation is available as open-source software.

0.49

PoliVEM: a Python-driven virtual element framework for computational solid mechanics

cs.SE ·2026-09-26 ·Paulo Akira F. Enabe, Rodrigo Provasi
similarity 0.59
Abstract

This work presents PoliVEM, a software framework for the Virtual Element Method (VEM) in computational solid and structural mechanics. A C++17 computational core and a Python interface place one-dimensional beams, two- and three-dimensional elasticity, axisymmetric elasticity, transient diffusion, and finite-strain hyperelasticity in a common implementation. The framework stores vertex, edge, face, and cell degrees of freedom in one hierarchy, constructs the energy, strain, and $L^2$ projections from common polynomial data, and retains the consistency--stabilization split at the element level. The core separates the mesh, material, element, assembler, and solver responsibilities and combines them by composition. A new formulation supplies its projection, discrete form, and stabilization while reusing the mesh representation, degree-of-freedom numbering, boundary-condition treatment, sparse assembly, algebraic solvers, and Python binding pattern. The numerical infrastructure includes polygonal and polyhedral mesh input, higher-order entity numbering, cached projection operators, static condensation, coloured sparse assembly, linear solver selection based on the matrix structure, an incremental Newton method with line search and regularization, and explicit and implicit time integration. Three numerical experiments examine the shared implementation through polynomial reproduction, recovery after static condensation, higher-order degree-of-freedom handling, polygonal and polyhedral meshes, patch tests, stiffness spectra, and comparisons with independent finite element calculations. The results verify the common core for the beam and two- and three-dimensional elasticity formulations. They also identify the scaling of high-order polynomial bases on anisotropic cells and the memory required by sparse direct factorizations as the main limitations of the current implementation.

0.22

Running error bounds in finite element kernels

cs.MS math.NA ·2026-09-29 ·Michal Habera, Paul T. Kühner, Matteo Croci, Andreas Zilian
code/data similarity 0.56
Abstract · 18 pages

Rounding errors in finite element computations can lead to a complete loss of accuracy, stalled convergence, and incorrect results. Moreover, the effects of rounding errors accumulated within automatically generated and compiled kernels are difficult to analyze a priori. We present the first software framework for automated rounding error estimation within finite element kernels. The proposed methodology is based on an a posteriori technique called Running Error Analysis (REA), where a forward error estimate is automatically computed concurrently with the value. An open-source implementation is provided for the FEniCS Form Compiler (FFCx), based on a C++ backend for generating type-generic templated kernels over a custom arithmetic type that tracks both the value and its error estimate. We demonstrate REA on two examples. First, we use it to detect catastrophic cancellation in the assembly of a Neo-Hooke hyperelastic model in the small deformation regime. A series expansion circumvents the cancellation problem and the computed error estimates show this. Second, we study the assembly of the Laplace operator on a near-degenerate mesh. We demonstrate that our REA implementation typically incurs only 2-4x performance overhead. Applications of this work include robust reduced-precision computations in embedded systems, numerical debugging of new, possibly ill-conditioned or unstable PDE formulations, and guiding the design of mixed-precision kernels.

0.40

JAXIGA - A software framework for GPU-enabled and differentiable isogeometric analysis

cs.MS math.NA ·2026-10-06 ·Cosmin Anitescu, Yongjie Jessica Zhang
benchmarkcode/dataunusual similarity 0.56
Abstract

In this paper, we present JAXIGA, an open-source library for isogeometric analysis based on JAX. The library separates the construction of the mesh from the computations which are traced for compilation and differentiation. This allows geometry evaluation, assembly and the supported solvers to be combined in a just-in-time compiled program, for which first-order reverse-mode derivatives can be computed. We consider three numerical methods obtained from a single pointwise energy density. The Galerkin and energy-minimization methods use the same discrete potential and have the same stationary points, while collocation enforces the corresponding strong form. The sensitivities of a converged solution are obtained by solving one adjoint problem, and their accuracy depends on the tolerances of both the primal and adjoint problems. We also describe hierarchical extraction for local refinement of the variational methods and the use of smooth spline spaces for fourth-order problems. The numerical results are compared with analytical solutions and independent FEniCSx and JAX-FEM computations. For the reported GPU benchmark with 36,448 unknowns, assembly is twenty-four times faster than on the host CPU. When the conjugate-gradient solver is also run on the GPU, the total solution time is reduced from 31.8 to 1.38 seconds, and the result agrees with the direct solution to $5\times10^{-11}$. These results show that the choice of solver and the reuse of compilation are important for obtaining an overall reduction in computational cost.

0.35

A Non-intrusive Approach for the Imposition of Strong Dirichlet Boundary Conditions in Unfitted Boundary Meshes

cs.CE cs.SEphysics.comp-ph ·2026-09-14 ·J. I. Camarotti, R. Aristio, R. Rossi, R. Zorrilla, R. Wüchner
published similarity 0.56
Abstract

The enforcement of essential boundary conditions is a fundamental challenge in unfitted boundary methods. This paper presents a non-intrusive, black-box strategy for imposing such conditions in unfitted meshes. The approach is intended for situations where the user does not have access to the solver's source code or its mathematical formulation, which is often the case when using commercial software. The proposed algorithm allows solvers originally designed for body-fitted meshes to be used in unfitted cases, provided that four conditions are satisfied: (i) the solver must support user customization by means of scripting, (ii) allow the imposition of Dirichlet boundary conditions at the node level through scripting, (iii) permit the deactivation of elements outside the physical domain, and (iv) provide access to the solution gradient within active elements. The last condition can also be satisfied by externally reconstructing the gradient from nodal values and connectivity information, provided the element formulation is known, making it optional in practice. These requirements are very fair demands and are satisfied by the vast majority of production-ready, possibly commercial, codes. In the current work, we show the application of this non-intrusive algorithm in the context of the Finite Element Method (FEM) and Isogeometric Analysis (IGA) discretizations, demonstrating optimal $L^2$-norm error convergence. This is demonstrated using the Kratos Multiphysics code (release \texttt{v10.1}) \emph{from the user API, simply leveraging the capabilities mentioned above.}

0.61

Application-Defined Abstractions to Separate Numerical Intent from Computation Orchestration

cs.SE cs.MS ·2026-11-08 ·Elena Aschmann, Anshu Dubey, Mohamed Wahib, Jens Domke
similarity 0.53
Abstract

In High-performance Computing the holy grail has been to translate numerical algorithms expressed in mathematical notation into code that performs well across a range of platforms. A variety of portability frameworks have abstracted data layout, parallelization and orchestration from application's view, however, the resulting format is still code that conforms to the idioms of the framework. Additionally, substantial refactoring is typically needed to achieve performance goals. Increasing sophistication of Large Language Models (LLMs) naturally raises the question whether they can be used to make application codes and/or solvers both portable and performant. The obstacle is the lack of correctness guarantee in LLM produced code. In this paper we pose the question differently -- can we start with expressing numerical intent of the code into an immutable core arithmetic component isolated from the surrounding code such that the surrounding code can be safely generated by the LLMs? We answer this question by using Spark, a mature compressible hydrodynamics solver in Flash-X, a multiphysics software system. We use LLM assistance in devising the abstractions and embedding them in the solver. Once properly verified, the resulting solver is lowered to concrete realization deterministically with tools also built with LLM assistance. The driver of the numerics and the code for interfacing with the application are generated by the LLMs. The resulting solver is exercised within Flash-X and with a separate environment we built for this experiment. Our results show that this is a viable approach for producing correct and performance portable code.

0.35

Representing Tensors as Compositions for Efficient Computation on Sparse and Structured Data

cs.LG cs.MScs.PL ·2026-11-07 ·Valérian Rey, Praneth Paruchuri
code/data similarity 0.53
Abstract · 15 pages, 6 figures

We propose a new mathematical formalism in which all kinds of tensors and of operations on those tensors are represented as simple function compositions. Tensors are functions from indices to values. An element-wise operation (e.g. an activation function) is a composition with a function applied to values; re-indexing (e.g. reshape, transposition) is a composition with a function applied to indices; and a reduction is a composition with both an index function, mapping each index to several indices, and a reduction operation (e.g. product, sum, max). Combined with tensor stacking, these compositions can represent most interesting kinds of tensors (e.g. dense, jagged, all kinds of sparsity patterns, matrix factorizations), as well as lazy versions of almost every operation available in modern tensor computation frameworks, including einsums between tensors of any kind. Identities between compositions can then be used to rewrite such expressions into equivalent ones, without evaluating them. For instance, the product of two sparse matrices can be rewritten so that only products between non-zero values are computed, turning a sparse problem into a dense one. Using this algebra as the intermediate representation of a tensor computation engine would shift the focus from defining operations on tensors (e.g. einsum between sparse tensors) to defining an algebra on index functions. This should reduce the codebase complexity from $\mathcal{O}(mn^2)$, with $m$ the number of binary operations between tensors and $n$ the number of tensor types, to $\mathcal{O}(m + k^2)$, with $k$ the number of types of index functions. A draft implementation of a tensor computation framework based on this algebra is publicly available.

0.21

Scaled boundary finite elements for FFT-based computational micromechanics

cs.CE math.NA ·2026-11-16 ·Flavia Gehrig, Carolin Birk, Matti Schneider
similarity 0.53
Abstract · 32 pages, 7 figures. Submitted to International Journal of Numerical Methods in Engineering

We introduce a matrix-free FFT-based solver for three-dimensional linear elastic homogenization problems discretized by the scaled boundary finite element method (SBFEM) on a voxel grid. Owing to its analytical solution in the radial direction, the SBFEM discretization is inherently softer than fully integrated voxel finite elements, whereas its displacement-based formulation remains symmetric, conforming, and supports arbitrary stiffness anisotropy. These properties make SBFEM an attractive candidate for porous and highly heterogeneous microstructures, where existing voxel-based FFT discretizations offer no generally reliable choice: Reduced-integration hexahedral elements, equivalently the rotated staggered grid discretization, may suffer from hourglass instabilities in the presence of voids, whereas fully integrated hexahedral elements are often too stiff. The proposed discretization uses hexahedral SBFEM cells on the full voxel mesh of a regular periodic grid, retaining the simplicity of a fixed-resolution voxel representation without requiring adaptive mesh coarsening. The main contribution is a preconditioner based on the homogeneous SBFEM stiffness operator. We show that this preconditioner may be applied locally in Fourier space and that the condition number of the preconditioned system is bounded by the material contrast, independently of the grid resolution. This result enables a fully matrix-free implementation of the SBFEM-discretized problem, without assembling or storing the global stiffness matrix. Numerical experiments on a short-fibre reinforced composite, a polyurethane foam and a sand-based binder jet microstructure demonstrate robust convergence and competitive accuracy compared with established voxel discretizations. In particular, SBFEM remains stable for porous microstructures, for which reduced-integration hexahedral elements become unstable.

0.39