# Appendix A. Some basic computations between reference and real elements¶

## Volume integral¶

One has

Denoting \(J_{\tau}(\widehat{x})\) the jacobian

one finally has

When \(P = N\), the expression of the jacobian reduces to \(J_{\tau}(\widehat{x}) = |\mbox{det}(K(\widehat{x}))|\).

## Surface integral¶

With \(\Gamma\) a part of the boundary of \(T\) a real element and \(\widehat{\Gamma}\) the corresponding boundary on the reference element \(\widehat{T}\), one has

where \(\widehat{n}\) is the unit normal to \(\widehat{T}\) on \(\widehat{\Gamma}\). In a same way

For \(n\) the unit normal to \(T\) on \(\Gamma\).

## Derivative computation¶

One has

## Second derivative computation¶

Denoting

the \(N \times N\) matrix and

the \(P \times P\) matrix, then

and thus

In order to have uniform methods for the computation of elementary matrices, the Hessian is computed as a column vector \(H f\) whose components are \(\frac{\partial^2 f}{\partial x^2_0}, \frac{\partial^2 f}{\partial x_1\partial x_0},\ldots, \frac{\partial^2 f}{\partial x^2_{N-1}}\). Then, with \(B_2\) the \(P^2 \times P\) matrix defined as

and \(B_3\) the \(N^2 \times P^2\) matrix defined as

one has

## Example of elementary matrix¶

Assume one needs to compute the elementary “matrix”:

The computations to be made on the reference elements are

and

Those two tensor can be computed once on the whole reference element if the geometric transformation is linear (because \(J(\widehat{x})\) is constant). If the geometric transformation is non-linear, what has to be stored is the value on each integration point. To compute the integral on the real element a certain number of reductions have to be made:

- Concerning the first term (\(\varphi_{i_1}^{i_0}\)) nothing.
- Concerning the second term (\(\partial_{i_4}\varphi_{i_3}^{i_2}\)) a reduction with respect to \(i_4\) with the matrix \(B\).
- Concerning the third term (\(\partial^2_{i_7 / P, i_7\mbox{ mod }P} \varphi_{i_6}^{i_5}\)) a reduction of \(\widehat{t}_0\) with respect to \(i_7\) with the matrix \(B_3\) and a reduction of \(\widehat{t}_1\) with respect also to \(i_7\) with the matrix \(B_3 B_2\)

The reductions are to be made on each integration point if the geometric transformation is non-linear. Once those reductions are done, an addition of all the tensor resulting of those reductions is made (with a factor equal to the load of each integration point if the geometric transformation is non-linear).

If the finite element is non-\(\tau\)-equivalent, a supplementary reduction of the resulting tensor with the matrix \(M\) has to be made.