Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

 Open In Colab

Shape functions are generally chosen to approximate the (unknown) function on each element in terms of the weights discussed above, which are generally called the degrees of freedom (DOFs).

The choice of element type determines:

  • the function which approximates the solution on the element.

  • the nodes - the points within the element at which the degrees of freedom are specified.

  • the meaning of the DOFs which might be:

    • function value

    • gradient

    • divergence of a vector field

  • the continuity of the approximate solution between elements.

  • integration scheme (typically in terms of the Gauss Points).

One might consider placing DOFs at the Gauss Points to expedite integration, but this is not common. It is more important for the the shape functions should reflect the behaviour of the solution (e.g.: continuity, conservation of divergence, high order variations.

Lagrange elements

A general purpose basis is our good old Lagrange interpolation functions! These functions have nodes at the verticies of the mesh (at least), at which the value of the function is specified. Higher order elements (i.e. higher order polynomials) include additional nodes inside the element.

LaGrange shape functions are 1 at the associated node and 0 at every other node.

ϕi(xj)=δij\phi_i(x_j) = \delta_{ij}

The first three orders (in 1D) are:

OrderNode ................Basis Function..................................................
0x0=0x_0 = 0ϕ0(x)=1\phi_0(x) = 1
1x0=0x_0 = 0ϕ0(x)=1−x\phi_0(x) = 1 - x
x1=1x_1 = 1ϕ1(x)=x\phi_1(x) = x
2x0=0x_0 = 0ϕ0(x)=2(1−x)(0.5−x)\phi_0(x) = 2(1 - x)(0.5 - x)
x1=0.5x_1 = 0.5ϕ1(x)=4x(1−x)\phi_1(x) = 4x(1 - x)
x2=1x_2 = 1ϕ2(x)=2x(x−0.5)\phi_2(x) = 2x(x - 0.5)
3x0=0x_0 = 0ϕ0(x)=−9/2(x−1/3)(x−2/3)(x−1)\phi_0(x) = -9/2 (x - 1/3)(x - 2/3)(x - 1)
x1=1/3x_1 = 1/3ϕ1(x)=27/2x(x−2/3)(x−1)\phi_1(x) = 27/2 x(x - 2/3)(x - 1)
x2=2/3x_2 = 2/3ϕ2(x)=−27/2x(x−1/3)(x−1)\phi_2(x) = -27/2 x(x - 1/3)(x - 1)
x3=1x_3 = 1ϕ3(x)=9/2x(x−1/3)(x−2/3)\phi_3(x) = 9/2 x(x - 1/3)(x - 2/3)

as plotted below.

Loading...
Loading...

Continuity

Since the LaGrange Shape functions are defined at least on the mesh verticies, those DOFs may be shared between adjacent elements. This enforces continuity in the solution at the nodes (at least the verticies) and, if both adjacent elements are off the same type/order, along ∂Ω\partial \Omega too.

The flux / first derivative however is not generally continuous. However, the weak form does not require this continuity to approximate a second order (in space) PDE!

Take another look at the Lagrange element order 0 above. It doesn’t have DOFs at the end points and so this is actually a discontinuous lagrange element.

Example: Tent functions

An illustrative example is the 1D Linear LaGrange elements which are lines inside the element (interval). Continuity between elements implies sharing the vertex values and therefore we see tent / triangle functions.

Note that since the shape functions are 1 only at the mesh verticies, calculating the weights is as easy as evaluating the function at those points!

<Figure size 1000x600 with 1 Axes>

2D and 3D, and other shapes

Extension to 2D and 3D is fairly straight-forward, beginning with the verticies and then refining by subdivision.

elements.png

Advanced elements

The field of Finite Elements is very rich, with elements designed specifically for certain types of physics e.g.:

  • Curl of a vector field

  • Divergence of a vector field

  • Discontinuous elements

  • Spectral Elements (very high order based on orthogonal shape functions).

A first step may be the Periodic Table of Finite Elements