[petsc-users] left and right preconditioning with a constant null space

Klaij, Christiaan C.Klaij at marin.nl
Fri Mar 24 10:11:39 CDT 2017


I've written a small PETSc program that loads the four blocks,
constructs Sp, attaches the null space and solves with a random
rhs vector.

This small program replicates the same behaviour as the real
code: convergence in the preconditioned norm, stagnation in the
unpreconditioned norm.

But when I add a call to remove the null space from the rhs
vector ("MatNullSpaceRemove"), I do get convergence in both
norms! Clearly, the real code must somehow produce an
inconsistent rhs vector. So the problem is indeed somewhere else
and not in PCFieldSplit.

Chris



dr. ir. Christiaan Klaij  | Senior Researcher | Research & Development
MARIN | T +31 317 49 33 44 | mailto:C.Klaij at marin.nl | http://www.marin.nl

MARIN news: http://www.marin.nl/web/News/News-items/Meet-us-again-at-the-OTC-2017.htm

________________________________________
From: Klaij, Christiaan
Sent: Friday, March 24, 2017 1:34 PM
To: Lawrence Mitchell; Matthew Knepley
Cc: petsc-users at mcs.anl.gov
Subject: Re: [petsc-users] left and right preconditioning with a constant null space

I've also loaded the four blocks into matlab, computed

  Sp = A11 - A10 inv(diag(A00)) A01

and confirmed that Sp has indeed a constant null space.

Chris
________________________________________
From: Klaij, Christiaan
Sent: Friday, March 24, 2017 9:05 AM
To: Lawrence Mitchell; Matthew Knepley
Cc: petsc-users at mcs.anl.gov
Subject: Re: [petsc-users] left and right preconditioning with a constant null space

Lawrence,

I think you mean "-fieldsplit_1_mat_null_space_test"? This
doesn't return any info, should it? Anyway, I've added a "call
MatNullSpaceTest" to the code which returns "true" for the null
space of A11.

I also tried to run with "-fieldsplit_1_ksp_constant_null_space"
so that the null space is only attached to S (and not to
A11). Unfortunately, the behaviour is still the same: convergence
in the preconditioned norm only.

Chris
________________________________________
From: Lawrence Mitchell <lawrence.mitchell at imperial.ac.uk>
Sent: Thursday, March 23, 2017 4:52 PM
To: Klaij, Christiaan; Matthew Knepley
Cc: petsc-users at mcs.anl.gov
Subject: Re: [petsc-users] left and right preconditioning with a constant null space

On 23/03/17 15:37, Klaij, Christiaan wrote:
> Yes, that's clearer, thanks! I do have is0 and is1 so I can try
> PetscObjectCompose and let you know.
>
> Note though that the viewer reports that both S and A11 have a
> null space attached... My matrix is a matnest and I've attached a
> null space to A11, so the latter works as expected. But is the viewer
> wrong for S?

No, I think this is a consequence of using a matnest and attaching a
nullspace to A11.  In that case you sort of "can" set a nullspace on
the submatrix returned in MatCreateSubMatrix(Amat, is1, is1), because
you just get a reference.  But if you switched to AIJ then you would
no longer get this.

So it happens that the nullspace you set on A11 /is/ transferred over
to S, but this is luck, rather than design.

So maybe there is something else wrong.  Perhaps you can run with
-fieldsplit_1_ksp_test_null_space to check the nullspace matches
correctly?

Lawrence



More information about the petsc-users mailing list