2-D FEM shape functions

Compute the shape functions at try the interpolation at different “integration” pints within the element.

[31]:
import numpy as np
[32]:
#def shapes():
#
#    N1 = ?
#    N2 = ?
#    N3 = ?
#    N4 = ?

#    N = np.array([N1, N2, N3, N4])

#    return N
[33]:
#hide: the code in this cell is hidden by the author
[38]:
# 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 = 0
eta = 0

# shape functions at integration point
N, dNds = shapes()

#interpolation
print(sum(N*T))
print(sum(dNds[1,:]*T))
[[-1  1  1 -1]
 [-1 -1  1  1]]
[0 0 1 1]
0.5
0.5
[ ]: