I'm trying to work on 4 Poisson's equations defined on a DMDA grid, Hence the parameter dof in DMDACreate3d should be 4, and I've set stencil width to be 4, and stencil type to be star.
If I run the code with -pc_type ilu and -ksp_type gmres, it works alright. However, if I run with pc_type mg, it gives me an error saying that when it is doing MatSetValues, the argument is out of range, and there is a new nonzero at (60,64) in the matrix. However, that new nonzero is expected to be there, the row number 60 corresponds to i=15 and c=0 in x direction, and the column number 64 corresponds to i=16 and c=0 in x direction. So they are next to each other, and the star stencil with width 1 should include that. I have also checked with the memory allocations, and I'm found no problem. So I'm wondering if there is any problem of using multigrid on a DMDA with dof greater than 1? Thank you!