# 10 basis functions in the reference tetrahedro (fem)

I'm writting a Finite Element code and I need the 10 basis functions in $\mathbb{P}^2(\hat K)$ (polynomial of degree less than or equal to 2 defined over the reference tetrahedro $\hat K$) in the reference tetrahedro with vertices:

$(0,0,0),(1,0,0),(0,1,0)$ and $(0,0,1)$.

Do you know a book or link that contains this?

In the book The finite element method - Theory, implementation and applications by Larson et al. there is a fairly general procedure for finding the shape functions. It is based on the Vandermonde matrix and goes as follows:

A general second-order polynomial $v(x_1,x_2,x_3)$ on the tetrahedron is of the form $$v(x_1,x_2,x_3) = c_0 + c_1 x_1 + c_2 x_2 + c_3 x_3 + c_4 x_1 x_2 + c_5 x_2 x_3 + c_6 x_1 x_3 + c_7 x_1^2 + c_8 x_2^2 + c_9 x_3^2.$$ The degrees of freedom $L_j$, $j\in\{1,\cdots\!,10\}$, are the nodal values and the edge middle point values: $$L_1(v) = v(0,0,0);\quad L_2(v)=v(1,0,0);\quad \cdots \quad L_{10}(v)=v(0,0.5,0.5).$$ Note that you may choose the order as you wish. Then the Vandermonde matrix is $$\begin{pmatrix} L_1(1) & L_1(x_1) & L_1(x_2) & \cdots & L_1(x_3^2) \\ L_2(1) & L_2(x_1) & L_2(x_2) & \cdots & L_2(x_3^2) \\ L_3(1) & L_3(x_1) & L_3(x_2) & \cdots & L_3(x_3^2) \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ L_{10}(1) & L_{10}(x_1) & L_{10}(x_2) & \cdots & L_{10}(x_3^2) \end{pmatrix}.$$ By evaluating the elements of this matrix and taking its inverse you may read the respective coefficients $c_0,\cdots,c_9$ from the columns of the inverse matrix. For this particular case I made a short Mathematica-script to evaluate the coefficients and it revealed that the shape functions are \begin{aligned} \phi_1&=1-3x_1-3x_2-3x_3+4x_1 x_2 + 4 x_2 x_3 + 4 x_1 x_3+2x_1^2+2x_2^2+2x_3^2,\\ \phi_2&=-x_1+2x_1^2,\\ \phi_3&=-x_2+2x_2^2,\\ \phi_4&=-x_3+2x_3^2,\\ \phi_5&=4x_1-4x_1x_2-4x_1x_3-4x_1^2,\\ \phi_6&=4x_2-4x_1x_2-4x_2x_3-4x_2^2,\\ \phi_7&=4x_3-4x_2x_3-4x_1x_3-4x_3^2,\\ \phi_8&=4x_1x_2,\\ \phi_8&=4x_1x_3,\\ \phi_9&=4x_2x_3.\\ \end{aligned} I did not verify the shape functions in any way. Thus, you may want to redo the calculations.

On page 134 of this thesis, the 10 base functions on the reference element are listed.

Also, I wrote some code in order to find the base functions for arbitrary dimension and order: http://pastebin.com/KmcgBNTw

You can use Volume coordinates of the Linear Tetrahedron (4 Nodes), you have first to compute your volume coordinates L1, L2, L3, L4.

Then you use them in order to obtain the basis function for higher order tetrahedrons (Quadratic and even cubic).

The expression of The basis functions in function of Volume coordinates have many advantages, it helps you a lot when you are faced with Integration Calculus (Mass and stiffness matrix).

In addition, if you use the formula of "Eisenberg and Malvern" it will give you exact integration.

I will let you see the pictures and the link below