[petsc-dev] PCBDDCSetNullSpace

Barry Smith bsmith at mcs.anl.gov
Wed Sep 19 07:51:30 CDT 2012

On Sep 19, 2012, at 7:06 AM, Jed Brown <jedbrown at mcs.anl.gov> wrote:

> On Wed, Sep 19, 2012 at 3:15 AM, Stefano Zampini <stefano.zampini at gmail.com> wrote:
> MatSetNullSpace triggers KSPSetNullSpace when doing KSPSetup. This in turn activates MatNullSpaceRemove after PCApply and destroys the convergence of BDDC, since it changes the preconditioned operator.
> Uh, the PC shouldn't be putting any contribution in the null space of the operator.
> With BDDC, if you have a linear system with a non-trivial kernel, you need to take care of when projecting the residual vector onto the coarse null space and remove it after expanding the coarse solution onto the partially subassembled space. You don't need to remove the null space from the preconditioned vector; instead, you need to properly calculate the null space of the coarse problem (see function AdaptNullSpace and lines 4164-4220 in bddc.c), and remove it around coarse problem solving (see lines 2014-2022 in bddc.c).
> You have to do basically the same thing on coarse levels of multigrid. I guess what you're saying is that a side-effect of this treatment in BDDC is that the preconditioner already has zero component in the direction of the null space so the explicit removal is not necessary? If we're just trying to avoid the explicit projection in KSP_PCApply*, I would prefer to add an attribute to PC saying that it "handles the null space internally".
> (I hate having new implementation-specific interfaces that basically do the same thing from the user's perspective, thus I want to find a way for MatSetNullSpace() to do the right thing.)

   We could modify KSP_RemoveNullSpace() to inquire of the PC inside the KSP if the null space should be applied and BDDC could simply say no.


   BTW: those macros KSP_RemoveNullSpace() and friends should all become functions. As we strife to eliminate macro functions from PETSc.

More information about the petsc-dev mailing list