[petsc-users] solving singular system

Jed Brown jed at 59A2.org
Wed Sep 1 16:58:07 CDT 2010


On Wed, 1 Sep 2010 15:34:57 -0600, Benjamin Sanderse <B.Sanderse at cwi.nl> wrote:
> Hi guys,
> 
> I am trying to solve a singular matrix that results from the discretization of a Poisson equation with Neumann boundary conditions. In this case the null space consists of a constant vector.
> According to the manual MatNullSpaceCreate should be used to construct the null space. Since the constant functions are not needed when providing basis vectors, I am wondering what I should put as basis vectors? My code is now:
> 
> PetscInt zero=0
> 
> MatNullSpaceCreate(PETSC_COMM_WORLD,PETSC_TRUE,zero,???,&nsp);

You can just pass PETSC_NULL (0), that argument is never looked at
because you specify that there are zero vectors.

Jed


More information about the petsc-users mailing list