Finite Element Method Code Python