Modern C++ design: generic programming and design patterns applied
Modern C++ design: generic programming and design patterns applied
C++ Templates
C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond (C++ in Depth Series)
Hi-index | 0.00 |
In most existing software packages for the finite element method it is not possible to supply the weak formulation of the problem of interest in a compact form, which was in the early days of programming due to the low abstraction capabilities of available programming languages. With the advent of pure object-oriented programming, abstraction was long said to be achievable only in trade-off with run time efficiency. In this work we show that it is possible to obtain both a high level of abstraction and good run time efficiency by the use of template metaprogramming in C++. We focus on a mathematical expressions engine, by which element matrices are computed during compile time and by which the weak formulation can be specified in a single line of code. A comparison of system matrix assembly times of existing finite element software shows that the template metaprogramming approach is up to an order of magnitude faster than traditional software designs.