Am I crazy or is the Jacobi iteration flipping the sign of u every iteration?
Also the swapping of u and tmp doesn't work like that in python. Might in fortran.