2-D FEM shape functions
Compute the shape functions at try the interpolation at different “integration” pints within the element.
[1]:
import numpy as np
[2]:
#def shapes():
#
# N1 = ?
# N2 = ?
# N3 = ?
# N4 = ?
# N = np.array([N1, N2, N3, N4])
# return N
[3]:
#hide: the code in this cell is hidden by the author
[27]:
# pseudo gcoord
GCOORD = np.array([[-1, 1, 1, -1],[-1, -1, 1, 1]])
#print(GCOORD)
# pseudo nodal temperatures
T = np.array([0, 0, 1, 1])
#print(T)
# interpolatin point
xi = 1
eta = 0.3
# shape functions at integration point
N, dNds = shapes(xi,eta)
#interpolation
print(N)
print(sum(dNds[1,:]*T))
print(sum(N*T))
[0. 0.35 0.65 0. ]
0.5
0.65
[9]:
sum(N)
[9]:
1.0
[ ]: