Python library for GaussSeidel Iterative Solver?
By : user2943486
Date : March 29 2020, 07:55 AM

Gauss seidel method not working for specific input
By : Francisco Acuña Amay
Date : March 29 2020, 07:55 AM

Improving Numpy speed for GaussSeidel (Jacobi) Solver
By : PrakashaShetty
Date : March 29 2020, 07:55 AM
it fixes the issue I've been able to reduce the running time in my laptop from 66 to 21 seconds by following this process: code :
expr = "temp = cr*((1  1/(2*ri[1:nr,1:nz]))*v[0:nr1,1:nz] + (1 + 1/(2*ri[1:nr,1:nz]))*v[2:nr+1,1:nz]) + cz*(v[1:nr,0:nz1] + v[1:nr,2:nz+1]); v[1:nr,1:nz] = temp"
temp = np.empty((nr1, nz1))
...
while ...
# internal updates
weave.blitz(expr)
from scipy import weave
# [...] Set up code till "# GaussSeidel solver"
tic = time.time()
max_v_diff = 1;
A = cr * (1  1/(2*ri[1:nr,1:nz]))
B = cr * (1 + 1/(2*ri[1:nr,1:nz]))
expr = "temp = A*v[0:nr1,1:nz] + B*v[2:nr+1,1:nz] + cz*(v[1:nr,0:nz1] + v[1:nr,2:nz+1]); v[1:nr,1:nz] = temp"
temp = np.empty((nr1, nz1))
while (max_v_diff > tol):
v_old = v.copy()
# left boundary updates
v[0,1:nz] = cr*2*v[1,1:nz] + cz*(v[0,0:nz1] + v[0,2:nz+2])
# internal updates
weave.blitz(expr, check_size=0)
# right boundary updates
v[nr,1:nz] = cr*2*v[nr1,1:nz] + cz*(v[nr,0:nz1] + v[nr,2:nz+1])
# reapply grid potentials
v[31:,29:40] = 1000
v[19:,54:65] = 200
# check for convergence
v_diff = v  v_old
max_v_diff = np.absolute(v_diff).max()
toc = time.time()  tic

GaussSeidel Solver for Python 2.7
By : Puspendra Chaurasiya
Date : March 29 2020, 07:55 AM
Hope this helps After a bit of searching around I found the solution was to use the numpy.linalg.solve command. The command uses the LAPACK gesv routine to solve the problem; however I am not sure what iterative technique this uses. Here is the code to solve the problem if anyone is interested: code :
a = np.array([[1,3,1],[2,5,1],[1,1,2]])
b = np.array([10,4,13])
x = np.linalg.solve(a, b)
print x
print np.allclose(np.dot(a, x), b) # To check the solution is found

Solving 1D Poisson Equation with Gauss Seidel Red Black
By : Santiago Galindo
Date : March 29 2020, 07:55 AM
Any of those help Watch out, I believe you are reading past the bounds of your V array during the black sweep: code :
//black sweep
for(int j=2; j <= 10; j+=2)
{
V[j] = 0.5*(0.00001*Q[j]V[j1]V[j+1]);
}

