The interface for functions in the dune-functions module

  • Christian Engwer (Author)
    Universität Münster
    Institute for Computational and Applied Mathematics
  • Carsten Gräser (Author)
    Freie Universität Berlin
    Institut für Mathematik
  • Steffen Müthing (Author)
    Universität Heidelber
    Institut für wissenschaftliches Rechnen
  • Oliver Sander (Author)
    TU Dresden

Identifiers (Article)

Abstract

The dune-functions Dune module introduces a new programmer interface for discrete and non-discrete functions. Unlike the previous interfaces considered in the existing Dune modules, it is based on overloading operator(), and returning values by-value.  This makes user code much more readable, and allows the incorporation of newer C++ features such as lambda expressions.  Run-time polymorphism is implemented not by inheritance, but by type erasure, generalizing the ideas of the std::function class from the C++11 standard library.  We describe the new interface, show its possibilities, and measure the  performance impact of type erasure and return-by-value.

Statistics

Last Weeks
KW
Downloads
Current Year
2019
Downloads
Prior Year
2018
Downloads
All Years
Downloads
Logo OA-Statistic
  • The statistics covers the time 19. October 2019 to 19. October 2019.
  • The statistics complies to COUNTER Code of Practice.
    More information can soon be found at the FAQ page.

References

[1] P. Bastian, M. Blatt, A. Dedner, C. Engwer, R. Klöfkorn, R. Kornhuber, M. Ohlberger, and O. Sander. A generic grid interface for adaptive and parallel scientific computing. Part II: Implementation and tests in DUNE. Computing, 82(2–3):121–138, 2008.

[2] P. Bastian, M. Blatt, A. Dedner, C. Engwer, R. Klöfkorn, M. Ohlberger, and O. Sander. A generic grid interface for adaptive and parallel scientific computing. Part I: Abstract framework. Computing, 82(2–3):103–119, 2008.

[3] K. Driesen and U. Hölzle. The direct cost of virtual function calls in C++. In Proceedings of the 11th ACM SIGPLAN Conference on Object-oriented Programming, Systems, Languages, and Applications, OOPSLA ’96, pages 306–323. ACM, 1996.

[4] C. Engwer, C. Gräser, S. Müthing, and O. Sander. Dune-functions module. http://www. dune-project.org/modules/dune-functions.

[5] J. Hubička. Devirtualization in C++. online blog, http://hubicka.blogspot.de/2014/
01/devirtualization-in-c-part-1.html, 2014. (at least) seven parts, last checked on Dec. 8. 2015.

[6] International Organization for Standardization. ISO/IEC 14882:2011 Programming Language C++, 9 2011.

[7] E. Niebler. Range-v3 library. https://github.com/ericniebler/range-v3.

[8] E. Niebler. Concept checking in C++11. online blog, http://ericniebler.com/2013/11/23/concept-checking-in-c11, 2013. last checked on Dec. 8. 2015.

[9] S. Parent, M. Marcus, and F. Brereton. Adobe source libraries. http://stlab.adobe.com/.

[10] S. Watanabe. Boost type erasure library. http://www.boost.org/doc/libs/release/libs/type_erasure/.

Supplementary Content

Published
2017-04-03
Section
Regular Articles
Language
en
Academic discipline and sub-disciplines
Scientific Computing; Computer Science; Software Design
Keywords
dune; dune-functions; functions; type erasure; return-by-value; duck typing