I am trying to do a basic linear FEM using this paper however there is something I am having difficulty to understand.
After obtaining the tetrahedra for the triangle mesh, the first thing we need to do is calculate the shape functions (H matrix (3x12) in the paper in eq. 1). Now from what I have read shape functions are nothing but the barycentric coordinates (b.c.) in a 3x3 diagonal matrix so we have 4 such matrices N0, N1, N2 and N3 containing the corresponding b.c. in them i.e. w0, w1, w2, w3. So it is like this,
Code: Select all
//w0, w1, w2, w3 are the barycentric coordinates
N0=[w0 0 0
0 w0 0
0 0 w0]
N1=[w1 0 0
0 w1 0
0 0 w1]
N2=[w2 0 0
0 w2 0
0 0 w2]
N3=[w3 0 0
0 w3 0
0 0 w3]
H=[N0 N1 N2 N3]