Series: Finite Element Method › Shape Functions on Reference Elements
The Tri6 Element
The Tri6 element is a 6-node quadratic triangle. It lives on
the same reference triangle as Tri3 but adds a node
at the midpoint of each edge, giving three vertex nodes and three edge-midpoint
nodes:
x^0=(0,0),x^1=(1,0),x^2=(0,1),
x^3=(21,0),x^4=(21,21),x^5=(0,21).
In the library, it is implemented in elements/tri6.py
by the class Tri6.
The shape functions are built from the barycentric coordinates
L0=1−x^−y^, L1=x^, L2=y^ introduced in
the Tri3 post. The pattern mirrors the quadratic
Lagrange basis polynomials
on [0,1]: vertex functions use Li(2Li−1) and edge-midpoint functions
use 4LiLj:
N0=L0(2L0−1),N1=L1(2L1−1),N2=L2(2L2−1),
N3=4L0L1,N4=4L1L2,N5=4L0L2.
Node i of each edge is shared between the two adjacent vertex functions; the
edge-midpoint function reaches its maximum of one at the midpoint and vanishes at
both endpoints. The figure below shows all six nodes on the reference triangle.

The gradients follow from the chain rule applied to the barycentric coordinates.
For the vertex functions,
∇N0=−(4L0−1)(11),∇N1=(4L1−1)(10),∇N2=(4L2−1)(01),
and for the edge-midpoint functions,
∇N3=4(1−2x^−y^−x^),∇N4=4(y^x^),∇N5=4(−y^1−x^−2y^).
The six shape functions form a partition of unity and span the full space of
quadratic polynomials on the triangle, so Tri6 can represent any quadratic
function exactly.