#NEWLINE# def diffuse_loops( iter_num ) : #NEWLINE# #INDENT# u = np . zeros ( ( Lx , Ly ) , dtype = np . float64 ) #NEWLINE# temp_u = np . zeros_like ( u ) #NEWLINE# temp_u [ ( ( Lx / 2 ) , ( Ly / 2 ) ) ] = 1000.0 #NEWLINE# for _ in range ( iter_num ) : #NEWLINE# #INDENT# for i in range ( 1 , ( Lx - 1 ) ) : #NEWLINE# #INDENT# for j in range ( 1 , ( Ly - 1 ) ) : #NEWLINE# #INDENT# u [ ( i , j ) ] = ( mu * ( ( ( ( temp_u [ ( ( i + 1 ) , j ) ] + temp_u [ ( ( i - 1 ) , j ) ] ) + temp_u [ ( i , ( j + 1 ) ) ] ) + temp_u [ ( i , ( iter_num - 1 ) ) ] ) - ( 4 * temp_u [ ( i , j ) ] ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# temp = u #NEWLINE# u = temp_u #NEWLINE# temp_u = temp #NEWLINE# #UNINDENT# return u