5. 1. 1 The Equations

For the sake of simplicity the treatment of the Laplace operator using the discretization schemes from Chapter 3 is discussed. For the first implementation only residual expressions are determined, however, the linearized expressions are shown in Setion 5.2. The expressions to be discretized are briefly reviewed:

$\displaystyle R_{\mathrm{FEM}}$ $\displaystyle := \sum_{VC}^{\underline{v}} \sum_{CV}^{\underline{c}} q K(\underline{c}, \underline{v}, \bullet) \; ,$ (5.1)
$\displaystyle R_{\mathrm{FVM}}$ $\displaystyle := \sum_{VE}^{\underline{v}} \mathcal{O}(\bullet, \underline{v}) \frac{A}{l} \sum_{EV}^{\underline{e}} \mathcal{O}(\underline{e}, \bullet) q \; ,$ (5.2)
$\displaystyle R_{\mathrm{BEM}}$ $\displaystyle := \sum_{\mathcal{B}V}^{\underline{v}} q K(\underline{v}, \bullet) \; ,$ (5.3)
$\displaystyle R_{\mathrm{FDM}}$ $\displaystyle := \sum_{VNV}^{\underline{v}} q \cdot K(\underline{v}, \bullet) \; .$ (5.4)

In the following implementation the coupling coefficients are determined locally with respect to geometric of physical quantities on the respective topological elements and are denoted as higher order functions K. For finite volumes the discretization formula is explicitly written.

 R_FEM = sum<VC>(_v)[sum<CV>(_c)[ q * K(_c, _v, _1) ]];
 R_FVM = sum<VE>(_v)[O(_1, _v)*A/d*sum<EV>(_e)[O(_e, _1) * q]];
 R_BEM = sum<CxV>(_v)[q * K(_v, _1)];
 R_FDM = sum<VNV>(_v)[q * K(_v, _1)];

It can be seen that the summation symbols $ \sum$ are replaced by sum. The different kinds of traversal methods are written within angles, for instance the vertex on cell function $ CV$ is referred to as <CV>. The named variables can be directly transformed into the DSEL by replacing $ \underline{v}$ by the similar and suggestive symbol v. This notation was taken from the Phoenix2 library [29] that intrinsically provides these symbols. Furthermore, the development of Phoenix2 was the main inspiration for choosing this special notation.

The let-symbol is also taken from the Phoenix2 library and given the symbol $ \vee$ within the functional calculus. Even though, the lambda function is also introduced in the Phoenix2 environment and can be directly introduced for creating higher order functions, its use was not required for the specification of discretized differential expressions. Furthermore, its use lead to a more complicated notation and drastically worsened the readability.

Higher order functions such as the quantities as well as the coupling functions can be taken directly from the Phoenix2 library, where a simple interfacing to the underlying topological and quantity structures is possible.

Within the syntax of C++ an own language (DSEL) can be defined with which different expressions can be specified in a straight-forward manner. For the specification of these objects, object generators [88] as well as template expressions [89,90] are used.

Michael 2008-01-16