How to Cite

Engwer, Christian, Gräser, Carsten and Müthing, Steffen: The interface for functions in the dune-functions module, in Blatt, Markus, Flemisch, Bernd and Sander, Oliver (Eds.): Proceedings of the 3rd Dune User Meeting (2015): Archive of Numerical Software - Special Issue 2017, Heidelberg: heiBOOKS, 2017, p. 95–110. https://doi.org/10.11588/heibooks.280.c3281

License (Chapter)

Creative Commons License

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Identifiers (Book)

ISBN 978-3-946531-60-9 (PDF)
ISBN 978-3-946531-61-6 (Softcover)

Published

07/24/2017

Authors

Christian Engwer, Carsten Gräser, Steffen Müthing, Oliver Sander

The interface for functions in the dune-functions module

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.