Extensible Programmatic Specification of Finite Element Methods
Theadora Fields Collin, Oded Stein, Gilbert Bernstein, Saman Amarasinghe
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.
Create a lesson
Related papers
The Rise of Low Precision Floating Point
Guy Lemieux, Michael L. Overton
Beyond atol and rtol: Sound Test Oracles for Low-Precision GPU Kernels
Xinyi Shi
survivalGPU: Scalable Survival Analysis for R and Python
Antoine Poirot-Bourdain, Alexis Van Straaten, Emmanuel Bacry et al.
diff-soup: GPU-native Differentiable Simulation and Inference for Large-scale Stiff Dynamical Systems
Samuel Degnan-Morgenstern, Martin Z. Bazant
py-ARGOS: A Python package for automatic, statistically principled discovery of ordinary differential equations from data
Yuzheng Zhang, Rui Carvalho
Native Rectangular Linear Assignment with Implicit Rejection: A Jonker-Volgenant Solver without Square Expansion
Ratha Siv