[petsc-users] Solving Poisson equation with multigrid

Jed Brown jedbrown at mcs.anl.gov
Wed May 29 23:05:01 CDT 2013


Michele Rosso <mrosso at uci.edu> writes:

> Hi,
>
> I proceeded as Matt suggested. I am running without nullspace 
> (Dirichlet's BCs) with the following options:
>
> -pc_type gamg  -pc_mg_cycle_type v  -pc_gamg_agg_nsmooths 1 
> -mg_coarse_sub_pc_factor_shift_type NONZERO -ksp_view -options_left
>
> The results are fine and the run finishes. The output of -ksp_view does 
> not say anything about the coarse solver being shifted.

With petsc-3.4, it has these lines:

          tolerance for zero pivot 2.22045e-14
          using diagonal shift on blocks to prevent zero pivot

You can try a proposed fix in the branch 'jed/fix-gamg-coarse'.



Hong, I think this diagnostic output is unintuitive for a user that
doesn't know this relation.  Shall we add the enum names to the output
lines below?

    if (factor->info.shifttype==(PetscReal)MAT_SHIFT_POSITIVE_DEFINITE) {
      ierr = PetscViewerASCIIPrintf(viewer,"  using Manteuffel shift\n");CHKERRQ(ierr);
    }
    if (factor->info.shifttype==(PetscReal)MAT_SHIFT_NONZERO) {
      ierr = PetscViewerASCIIPrintf(viewer,"  using diagonal shift to prevent zero pivot\n");CHKERRQ(ierr);
    }
    if (factor->info.shifttype==(PetscReal)MAT_SHIFT_INBLOCKS) {
      ierr = PetscViewerASCIIPrintf(viewer,"  using diagonal shift on blocks to prevent zero pivot\n");CHKERRQ(ierr);
    }


More information about the petsc-users mailing list