Code Generation for Finite Element Simulation: Interfacing AMDiS from Python

Research output: Types of thesisMaster thesis

Contributors

  • Jonathan Drechsel - (Author)

Abstract

In recent years, the use of Python for scientific computing has grown significantly due to its simplicity, readability, and extensive library ecosystem. However, Python’s performance in computationally intensive tasks often lags behind lower-level languages like C ++. To address this issue for the Adaptive Multi-Dimensional Simulation Toolbox (AMDiS), a finite element discretization module of the Distributed and Unified Numerics Environment (Dune), this thesis introduces Python bindings that closely mirror the efficient C ++ interface while introducing Pythonic features such as using properties and keyword arguments. Additionally, the integration of the Unified Form Language (UFL) into the Python interface provides an intuitive way to define Partial Differential Equations (PDEs) in Python code, which generates efficient C ++ code. The extensive discussion of the implementation of two example PDEs, the Poisson equation and the Cahn-Hilliard equation, demonstrates the usage and practicality of the proposed AMDiS Python interface. Runtime experiments indicate that the Python interface introduces an overhead of less than 15 % in certain scenarios. However, the frequent invocation of Python lambda functions from C ++ creates significant overhead. Notably, the generated UFL code for complex operators can be more efficient than C ++ code relying on standard AMDiS
operators.

Details

Original languageEnglish
Qualification levelMaster of Science
Awarding Institution
Supervisors/Advisors
Defense Date (Date of certificate)15 Apr 2024
Publication statusPublished - 2024
No renderer: customAssociatesEventsRenderPortal,dk.atira.pure.api.shared.model.researchoutput.Thesis