Increased efficiency in finite element computations through template metaprogramming

  • Authors:
  • Karl Rupp

  • Affiliations:
  • TU Wien, Wien, Austria

  • Venue:
  • SpringSim '10 Proceedings of the 2010 Spring Simulation Multiconference
  • Year:
  • 2010

Quantified Score

Hi-index 0.00

Visualization

Abstract

In the area of scientific computing, abstraction was long said to be achievable only in exchange for run time efficiency. With the rise of template metaprogramming [1] in C++ in the 1990s, run time efficiency comparable to hand tuned code could be achieved for isolated operations such as matrix-vector multiplication [2]. In more complex scenarios such as large finite element simulation packages, traditional object oriented programming is used for most abstractions, so the resulting code usually suffers from reduced run time efficiency. We have applied rigorous template metaprogramming to both the mesh handling and the mathematical algorithms acting on top, and obtain a high level of abstraction at a run time efficiency comparable to that of hand-tuned code. Since the weak formulation of the underlying mathematical problem is directly transferred to code, the code effectively meets the abstraction of the mathematical description, including an eventual independence from the underlying spatial dimension.