File size: 723 Bytes
76cb30c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | def iso_triangle(element_nodes, xi, eta):
from numpy import array
from numpy import sum
from numpy.linalg import det
from numpy.linalg import inv
shape = array([1.0 - xi - eta,xi,eta])
shape_dxi = array([-1.0,1.0,0.0])
shape_deta = array([-1.0,0.0,1.0])
x = element_nodes[:, 0]
y = element_nodes[:, 1]
jacobi = array([[sum(shape_dxi * x), sum(shape_dxi * y)],[sum(shape_deta * x), sum(shape_deta * y)]])
jacobian = det(jacobi)
inverted_jacobi = inv(jacobi)
shape_dx = inverted_jacobi[0, 0] * shape_dxi + inverted_jacobi[0, 1] * shape_deta
shape_dy = inverted_jacobi[1, 0] * shape_dxi + inverted_jacobi[1, 1] * shape_deta
return jacobian, shape, shape_dx, shape_dy |