×

Expression templates implementation of continuous and discontinuous Galerkin methods. (English) Zbl 1214.65059

Summary: Efficiency and flexibility are often mutually exclusive features in a code. This still prompts a large part of the Scientific Computing community to use traditional procedural languages. In the last years, however, new programming techniques have been introduced allowing for a high level of abstraction without loss of performance. In this paper we present an application of the Expression Templates technique introduced in [T. Veldhuizen, “Expression templates”, C++ Report Magazine 7, 26–31 (1995)] to the assembly step of a finite element computation. We show that a suitable implementation, such that the compiler has the role of parsing abstract operations, allows for user-friendliness. Moreover, it gains in performance with respect to more traditional techniques for achieving this kind of abstraction. Both the cases of conforming and discontinuous Galerkin finite element discretization are considered. The proposed implementation is finally applied to a number of problems entailing different kind of complications.

MSC:

65N30 Finite element, Rayleigh-Ritz and Galerkin methods for boundary value problems involving PDEs
68N19 Other programming paradigms (object-oriented, sequential, concurrent, automatic, etc.)

Software:

EXPDE; Diffpack
Full Text: DOI

References:

[1] Arnold D.N., Brezzi F., Cockburn B., Marini D.: Unified analysis of discontinuous galerkin methods for elliptic problems. SIAM J. Numer. Anal. 39, 1749–1779 (2002) · Zbl 1008.65080 · doi:10.1137/S0036142901384162
[2] Avgoustiniatos E., Colton C.: Effect of external oxygen mass transfer resistances on viability of immunoisolated tissue. Ann. NY. Acad. Sci. 831, 145–167 (1997) · doi:10.1111/j.1749-6632.1997.tb52192.x
[3] Cockburn B., Shu C.W.: Runge-kutta discontinuous galerkin methods for convection-dominated problems. J. Sci. Comp. 16, 173–261 (2001) · Zbl 1065.76135 · doi:10.1023/A:1012873910884
[4] Furnish G.: Disambiguated glommable expression templates. Comp. Phys. 11, 263–269 (1997)
[5] Haney, S.W.: Beating the abstraction penalty in c++ using expression templates. In: Computers in Physics, vol. 10, pp. 552–557. Correction in vol. 11, n. 14 (1996)
[6] Johnson C.: Numerical Solution of Partial Differential Equations by the Finite Element Method. Cambridge University Press, Cambridge (1987) · Zbl 0628.65098
[7] Langer, A., Kreft, K.: C++ expression templates. In: C/C++ Users Journal (2003)
[8] Langtangen H.: Computational Partial Differential Equations. Springer, Heidelberg (1999) · Zbl 0929.65098
[9] Pflaum C.: Epression templates for partial differential equations. Comp. Vis. Sci. 4, 1–8 (2001) · Zbl 0996.65117 · doi:10.1007/s007910100051
[10] Quarteroni, A., Valli A.: Numerical approximation of partial differential equations, no. 23. In: Springer Series in Computational Mathematics. Springer, Berlin (1994) · Zbl 0803.65088
[11] Sethian J.A.: Level Set Methods and Fast Marching Methods. 2nd edn. Cambdridge Press, New York (1999) · Zbl 0929.65066
[12] Stroustrup B.: The C++ Programming Language. Addison Wesley, Longman, Reading (2000) · Zbl 0825.68056
[13] Veldhuizen, T.: Expression templates. In: C++ Report Magazine, vol. 7, pp. 26–31. See also the web page http://osl.iu.edu/tveldhui (1995)
[14] Veldhuizen, T., Jernigan, M.: Will c++ be faster than fortran? In: Proc. First International Scientific Computing in Object Oriented Parallel Environments ’97. Springer, Heidelberg (1997)
This reference list is based on information provided by the publisher or from digital mathematics libraries. Its items are heuristically matched to zbMATH identifiers and may contain data conversion errors. In some cases that data have been complemented/enhanced by data from zbMATH Open. This attempts to reflect the references listed in the original paper as accurately as possible without claiming completeness or a perfect matching.