KSPSetNullSpace and CG for singular systems

Shao-Ching Huang schuang at ats.ucla.edu
Sat Aug 2 19:54:08 CDT 2008

On Sat, Aug 02, 2008 at 11:04:06AM +0100, Stephan Kramer wrote:

>> I am trying to use CG to solve a singular systems (i.e. Poisson
>> equation with periodic conditions on all boundaries). 
>> The code works when I use GMRES, but it diverges when I switch CG.
>> Since the null space is a constant vector, in the code I have:
> I might be missing something here, but aren't linearly varying vectors  
> in your null space as well?

By 'constant vector', I meant that the null space vector has the form:

   c * [ 1 1 ... 1 ]^T

where c is an arbitray real number (^T = transpose).

Linearly varying (in space) vectors do not satisfy the periodic
boundary condition -- so they are not part of the solutions.



More information about the petsc-users mailing list