# Multigrid Solver using Matlab for Poisson Equation

 Register Blogs Members List Search Today's Posts Mark Forums Read

 February 5, 2018, 07:35 Multigrid Solver using Matlab for Poisson Equation #1 Member   Suman Sapkota Join Date: Feb 2018 Posts: 32 Rep Power: 7 Hello, I coded multigrid solver for Poisson equation in matlab. In my case, I am making simple multigrid i.e. coarse grid correction cycle using 2 levels (fine and coarse grid). The problem is when I increase the number of points i.e. 'n' , the relaxations needed to get the required accuracy also increases. With two level grids, the relaxations required on fine 'v1' and coarse grid 'v2' , v1+v2<=3 should give the same solution. After all, we are using it for fast convergence. But I am not getting the same solution. My gauss siedel function is correct. I checked it with others. But the problem of requiring high relaxations has been troubling my convergence rate. Thus, i know the solver is not working properly. Please Help!!

February 5, 2018, 21:06
#2
Senior Member

Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,249
Rep Power: 31
Quote:
 Originally Posted by Suman Sapkota Hello, I coded multigrid solver for Poisson equation in matlab. In my case, I am making simple multigrid i.e. coarse grid correction cycle using 2 levels (fine and coarse grid). The problem is when I increase the number of points i.e. 'n' , the relaxations needed to get the required accuracy also increases. With two level grids, the relaxations required on fine 'v1' and coarse grid 'v2' , v1+v2<=3 should give the same solution. After all, we are using it for fast convergence. But I am not getting the same solution. My gauss siedel function is correct. I checked it with others. But the problem of requiring high relaxations has been troubling my convergence rate. Thus, i know the solver is not working properly. Please Help!!

Thats because you only use 2 levels. It is possible for the 2 levels to show the behaviour you mentioned.

Even if you used multiple levels but not solving completely at the coarsest level in this case too many times multigrid may stall and does not converge as fast as you expect.

Coarse level solution is absolutely important in case of multigrid.

 February 6, 2018, 02:37 #3 Member   Suman Sapkota Join Date: Feb 2018 Posts: 32 Rep Power: 7 Hello, Thank you for the rely. Does it mean that I am not solving the problem completely in the coarse grid though? I am solving Le= Ir where e= error, L=laplace operator, I= Interpolation constant and r= residual injected from fine grid. I took this equation in gauss siedel relaxation. solving this equation means that I suppose the problem is solved in coarse grid. Correct me if I am wrong.

February 6, 2018, 20:18
#4
Senior Member

Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,249
Rep Power: 31
Quote:
 Originally Posted by Suman Sapkota Hello, Thank you for the rely. Does it mean that I am not solving the problem completely in the coarse grid though? I am solving Le= Ir where e= error, L=laplace operator, I= Interpolation constant and r= residual injected from fine grid. I took this equation in gauss siedel relaxation. solving this equation means that I suppose the problem is solved in coarse grid. Correct me if I am wrong.

Yes it means that.

Gauss Seidel becomes ineffective as the problem size increases, so at the coarser level it won't be removing all the errors.

Multigrid gains efficiency by removing all frequencies of error by using coarser and coarser girds and each level is responsible for removing certain frequency of errors.

So at the coarsest level you have still some errors remaining that then completely solved by using a direct solver (Typically LU factorization).

 February 7, 2018, 09:47 #5 Member   Suman Sapkota Join Date: Feb 2018 Posts: 32 Rep Power: 7 But I am using an iterative solver. gauss siedel reduces the error efficiently than jacobi but is there any better option to solve the Le=Ir equation in coarse grid???.. where L = operator ; e=error; Ir= interpolated value of residual from fine grid. Another question is: Can the laplace operator that I use in the fine grid be used as the coarse grid L operator? because i am using same gauss siedel function to relax in both fine and coarse grid.

February 13, 2018, 00:19
#6
Senior Member

Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,249
Rep Power: 31
Quote:
 Originally Posted by Suman Sapkota But I am using an iterative solver. gauss siedel reduces the error efficiently than jacobi but is there any better option to solve the Le=Ir equation in coarse grid???...
Gauss Seidel is fine, it is doing what it is supposed to do.

There are other options but very unlikely that is the issue. Main thing is that for 2 level multigrid the behaviour you were complaining is possible

Quote:
 Originally Posted by Suman Sapkota Can the laplace operator that I use in the fine grid be used as the coarse grid L operator? because i am using same gauss siedel function to relax in both fine and coarse grid.
Thats makes something called geometric or full multigrid. Don't go in that direction, stick to algebraic version unless you are specifically asked to do geometric mg.

 Tags gauss siedel, laplace, matlab code, multigrid, poisson