@@ -82,7 +82,7 @@ def solver_dense(
8282 u_n = np .zeros ((Nx + 1 , Ny + 1 )) # u at the previous time level
8383
8484 Ix = range (0 , Nx + 1 )
85- Iy = range (0 , Ny + 1 )
85+ It = range (0 , Ny + 1 )
8686 It = range (0 , Nt + 1 )
8787
8888 # Make U_0x, U_0y, U_Lx and U_Ly functions if they are float/int
@@ -101,7 +101,7 @@ def solver_dense(
101101
102102 # Load initial condition into u_n
103103 for i in Ix :
104- for j in Iy :
104+ for j in It :
105105 u_n [i ,j ] = I (x [i ], y [j ])
106106
107107 # Two-dim coordinate arrays for vectorized function evaluations
@@ -130,7 +130,7 @@ def solver_dense(
130130 p = m (i ,j ); A [p , p ] = 1
131131 # Loop over all internal mesh points in y diretion
132132 # and all mesh points in x direction
133- for j in Iy [1 :- 1 ]:
133+ for j in It [1 :- 1 ]:
134134 i = 0 ; p = m (i ,j ); A [p , p ] = 1 # boundary
135135 for i in Ix [1 :- 1 ]: # interior points
136136 p = m (i ,j )
@@ -152,7 +152,7 @@ def solver_dense(
152152 j = 0
153153 for i in Ix :
154154 p = m (i ,j ); b [p ] = U_0y (t [n + 1 ]) # boundary
155- for j in Iy [1 :- 1 ]:
155+ for j in It [1 :- 1 ]:
156156 i = 0 ; p = p = m (i ,j ); b [p ] = U_0x (t [n + 1 ]) # boundary
157157 for i in Ix [1 :- 1 ]:
158158 p = m (i ,j ) # interior
@@ -176,7 +176,7 @@ def solver_dense(
176176
177177 # Fill u with vector c
178178 for i in Ix :
179- for j in Iy :
179+ for j in It :
180180 u [i ,j ] = c [m (i ,j )]
181181
182182 if user_action is not None :
@@ -228,7 +228,7 @@ def solver_sparse(
228228 u_n = np .zeros ((Nx + 1 , Ny + 1 )) # u at the previous time level
229229
230230 Ix = range (0 , Nx + 1 )
231- Iy = range (0 , Ny + 1 )
231+ It = range (0 , Ny + 1 )
232232 It = range (0 , Nt + 1 )
233233
234234 # Make U_0x, U_0y, U_Lx and U_Ly functions if they are float/int
@@ -247,7 +247,7 @@ def solver_sparse(
247247
248248 # Load initial condition into u_n
249249 for i in Ix :
250- for j in Iy :
250+ for j in It :
251251 u_n [i ,j ] = I (x [i ], y [j ])
252252
253253 # Two-dim coordinate arrays for vectorized function evaluations
@@ -271,7 +271,7 @@ def solver_sparse(
271271
272272 m = lambda i , j : j * (Nx + 1 ) + i
273273 j = 0 ; main [m (0 ,j ):m (Nx + 1 ,j )] = 1 # j=0 boundary line
274- for j in Iy [1 :- 1 ]: # Interior mesh lines j=1,...,Ny-1
274+ for j in It [1 :- 1 ]: # Interior mesh lines j=1,...,Ny-1
275275 i = 0 ; main [m (i ,j )] = 1 # Boundary
276276 i = Nx ; main [m (i ,j )] = 1 # Boundary
277277 # Interior i points: i=1,...,N_x-1
@@ -306,7 +306,7 @@ def solver_sparse(
306306 j = 0
307307 for i in Ix:
308308 p = m(i,j); b[p] = U_0y(t[n+1]) # Boundary
309- for j in Iy [1:-1]:
309+ for j in It [1:-1]:
310310 i = 0; p = m(i,j); b[p] = U_0x(t[n+1]) # Boundary
311311 for i in Ix[1:-1]:
312312 p = m(i,j) # Interior
@@ -329,7 +329,7 @@ def solver_sparse(
329329 f_a_n = f (xv , yv , t [n ])
330330
331331 j = 0 ; b [m (0 ,j ):m (Nx + 1 ,j )] = U_0y (t [n + 1 ]) # Boundary
332- for j in Iy [1 :- 1 ]:
332+ for j in It [1 :- 1 ]:
333333 i = 0 ; p = m (i ,j ); b [p ] = U_0x (t [n + 1 ]) # Boundary
334334 i = Nx ; p = m (i ,j ); b [p ] = U_Lx (t [n + 1 ]) # Boundary
335335 imin = Ix [1 ]
@@ -372,7 +372,7 @@ def CG_callback(c_k):
372372 % (CG_iter[-1], CG_tol))
373373 '''
374374 # Fill u with vector c
375- #for j in Iy : # vectorize y lines
375+ #for j in It : # vectorize y lines
376376 # u[0:Nx+1,j] = c[m(0,j):m(Nx+1,j)]
377377 u [:,:] = c .reshape (Ny + 1 ,Nx + 1 ).T
378378
@@ -443,7 +443,7 @@ def solver_classic_iterative(
443443 u_new = np .zeros ((Nx + 1 , Ny + 1 )) # help array
444444
445445 Ix = range (0 , Nx + 1 )
446- Iy = range (0 , Ny + 1 )
446+ It = range (0 , Ny + 1 )
447447 It = range (0 , Nt + 1 )
448448
449449 # Make U_0x, U_0y, U_Lx and U_Ly functions if they are float/int
@@ -462,7 +462,7 @@ def solver_classic_iterative(
462462
463463 # Load initial condition into u_n
464464 for i in Ix :
465- for j in Iy :
465+ for j in It :
466466 u_n [i ,j ] = I (x [i ], y [j ])
467467
468468 # Two-dim coordinate arrays for vectorized function evaluations
@@ -488,7 +488,7 @@ def solver_classic_iterative(
488488 j = 0
489489 for i in Ix :
490490 u [i ,j ] = U_0y (t [n + 1 ]) # Boundary
491- for j in Iy [1 :- 1 ]:
491+ for j in It [1 :- 1 ]:
492492 i = 0 ; u [i ,j ] = U_0x (t [n + 1 ]) # Boundary
493493 i = Nx ; u [i ,j ] = U_Lx (t [n + 1 ]) # Boundary
494494 for i in Ix [1 :- 1 ]:
0 commit comments