[petsc-users] How does KSPSetNullSpace() work?

Alexander Grayver agrayver at gfz-potsdam.de
Tue Jan 10 02:50:36 CST 2012


On 10.01.2012 04:57, Jed Brown wrote:
> On Mon, Jan 9, 2012 at 22:47, Mohamad M. Nasr-Azadani 
> <mmnasr at gmail.com <mailto:mmnasr at gmail.com>> wrote:
>
>     It might be a naive question, but I am wondering how
>     KSPSetNullSpace() works when it is passed to a linear system ksp
>     context?
>     Say, for instance, we have the simple case of Poisson equation
>     solved in a square domain and Neumann boundary condition applied
>     to all boundaries.
>     Does it take the integral of the solution and set it to zero as an
>     extra constraint?
>
>
> It just projects out whatever you provide as a null space, so the 
> Krylov method effectively runs in the remaining subspace.
  In examples listed on this page:

http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/KSP/KSPSetNullSpace.html

You set nullspace without any particular information:

ierr = MatNullSpaceCreate(PETSC_COMM_WORLD, PETSC_TRUE, 0, PETSC_NULL, 
&nullsp);
ierr = KSPSetNullSpace(ksp, nullsp);

What does it project and how works in this case?

Regards,
Alexander
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120110/40186b64/attachment.htm>


More information about the petsc-users mailing list