1
$\begingroup$

I am simulating $\nabla^{2}u=0$ with mixed Dirichlet-Neumann boundary conditions on 2-D using 2-Grid method. Dirichlet conditions are applied to left and bottom boundary with $u=1+x+y$ and Neuman conditions are applied to top and right boundary with $\frac{\partial u}{\partial n}=1$. The solution converges for 4x4 grid without using 2-grid. With 2-grid, please let me know if the following are correct (as I am unable to converge with 2-grid).

  1. I do 2 iterations on the fine grid (using Pure Jacobi), calculate residual, use injection to restrict to Coarse grid (2x2). Is it okay to use Pure Jacobi or do we always use Damped (weighted) Jacobi ?

  2. With error matrix $e=0$ as initial guess, I solve the residual equation $Ae =r$ till full convergence, then interpolate/prolongate the error back to fine grid. Should the residual equation be solved till convergence or would 2-3 iterations be sufficient ? ( The error equation does converge fully.)

  3. Where exactly do I have to use the norm of an error/residual/whatever ? Since I know the true solution on the Fine Grid is $u = 1 + i*h + j*h$ where h=1/4for i,j vary from 0 to4, I am using it as convergence criterion on the fine grid i.e. till $error = u_{new} - (1 + i*h + j*h)$ is greater than the tolerance of $10^{-5}$ keep iterating.

$\endgroup$
2
$\begingroup$

Jacobi is usually not a great smoother, Gauss-Seidel is a better choice.

You might also want to use a larger initial grid so you see whether the defect is being generated at the boundary or in the interior. Your 2x2 coarse grid is essentially all boundary condition.

Mixed boundaries are tricky to implement. I'd get only Dirichlet boundaries working, and then only Neumann working, and then try to mix them. You have to think carefully about how to handle restriction at the corners.

This discussion might also be helpful: Multigrid stops converging when more grid levels are used

$\endgroup$
  • $\begingroup$ Thanks Dan. I tried weighted Jacobi with $\omega=2/3$, but no convergence. I tried 8x8 fine grid so coarse grid is 4x4 - no convergence. I hand-checked my calculation with 4x4 fine grid - couldn't find errors. My mixed D-N boundary problem converges WITHOUT 2-grid, so am sure 2-grid is THE problem. I followed the discussion you pointed to, I am setting the boundaries and reference points on coarse grid correctly. (But of course I am making a mistake somewhere, that's why it is not converging !) $\endgroup$ – Gaurav Saxena Jun 3 '15 at 13:49
  • $\begingroup$ With pure Dirichlet with u=1 on the boundary, 2-grid does converge with Pure Jacobi but is not independent of h. Approximately when h doubles, iterations double. Should I still try Gauss-Seidel or there is something wrong with me 2-D grid algorithm already that posters can see ? $\endgroup$ – Gaurav Saxena Jun 3 '15 at 21:48
  • $\begingroup$ Sorry Dan I don't have the privileges to up vote your answer. But thanks for the systematic suggestions ! The boundary conditions for Neumann change when going from fine to coarse grid - so the culprit was that ! (I am a beginner with PDEs). $\endgroup$ – Gaurav Saxena Jun 4 '15 at 10:02
0
$\begingroup$

I used weighted Jacobi (doesn't work with pure Jacobi). In this problem the Neumann Boundary condition becomes $\frac{\partial e}{\partial n} = 0$ for the error matrix i.e. while solving $Ae = r$ if we take the central difference at the boundary of the coarse grid then $\frac{e_{i+1,j} - e_{i-1,j}}{2h_{c}} = 0$, where $e_{i,j}$ is the point on the Neumann boundary. Similarly $\frac{e_{i,j+1} - e_{i,j-1}}{2h_{c}} = 0$, where $e_{i,j}$ is a boundary point (and not the fictitious boundary point, of course !) on the coarse grid.

$\endgroup$
  • $\begingroup$ That sounds right to me. You have to solve homogeneous Neumann on the coarse grids, even if the fine grid has inhomogeneus Neumann boundaries. $\endgroup$ – Dan Jun 9 '15 at 12:42

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.