dunefunctions
dunefunctions
Abstractions for functions and discrete function space bases
Requires: 
dunelocalfunctions
dunegrid
dunetypetree

Suggests: 
duneistl

Git repository: 
https://gitlab.duneproject.org/staging/dunefunctions 
dunefunctions
The dunefunctions module provides an abstraction layer for global finite element functions. Its two main concepts are functions implemented as callable objects, and bases of finite element spaces.
Functions
dunefunctions provides an interface to “functions” in the mathematical sense, in particular to finite element functions defined on a grid, but going far beyond that.
The interface revolves around the concept of a “callable”. It encompasses any type of C++ object that can be evaluated with operator()
, like free functions, function objects, and even C++11 lambdas. Dynamic polymorphism is realized using type erasure and the std::function
class, which does not sacrifice efficiency in purely static code.
dunefunctions extends the “callable” concept into several directions. First, it allows for differentiable functions. Such functions can hand out their derivative as new function objects. Second, for functions defined piecewisely on a finite element grid, the concept of local function is introduced. Local functions can be bound to grid elements. All further evaluations of a function bound to an element are in local coordinates of that element. This approach allows to avoid overhead when there are many consecutive evaluations of a function on a single element.
Function Space Bases
The second part of dunefunctions provides a welldefined interface to bases of finite element function spaces. For this interface, a finite element basis is a set of functions with a prescribed ordering, and a way to index them. The core functionality has three parts:
 For a given grid element, obtain the restrictions of all basis functions to this element, except for those functions where the restriction is zero. In other words: get the shape functions for the element.
 Get a local numbering for these shape functions. This is needed to index the element stiffness matrix.
 Get a global numbering for the shape functions. This is needed to index the global stiffness matrix.
While local numbers are always integers, global numbers can be multiindices, if appropriate.
A central feature is that finite element bases for vectorvalued and mixed spaced can be constructed by tensor multiplication of simpler bases. The resulting expressions can be interpreted as tree structures. For example, the tree for the threedimensional TaylorHood basis is shown below. This tree structure is directly exposed in the dunefunctions interface.
Implementations of Function Space Bases
Currently, the following finite element bases are available:
 PQkNodalBasis: A kth order Lagrangian bases, with k a compiletime parameter.
 LagrangeDGBasis: A kth order DG basis, using Lagrangian shape functions.
 TaylorHoodBasis: The P2/P1 TaylorHood basis, for simplex, cube, and mixed grids.
 BSplineBasis: A basis of BSpline functions of given arbitrary order on a structured grid.
Download
You can download the current development version using anonymous git.
git clone https://gitlab.duneproject.org/staging/dunefunctions.git
The latest release is dunefunctions 2.5, available from the Dune download page. It is to be used with the 2.5 release of the Dune core modules. If you would like to use dunefunctions together with the Dune 2.4 release, you can use the releases/2.4compatible branch from the git repository mentioned above.
dunefunctions depends on the dunetypetree module, also available from the download page. Please install that before trying to install dunefunctions.
Documentation
The class documenation generated with doxygen is available online:
The module contains a manual that can be build using make doc
. Furtermore it contains example programs in the examples/
directory.
Mailing lists
dunefunctions development and discussions happen mainly on the dunefunctions mailing list.
Maintainers
dunefunctions has been mainly written by
 Christian Engwer
 Carsten Gräser
 Steffen Müthing
 Oliver Sander
See the COPYING file contained in the source code for a complete list.
We welcome interest and contributions by additional developers.