[petsc-users] Solving a Singular System with PETSc
Bojan Niceno
bojan.niceno.scientist at gmail.com
Sun Feb 27 01:36:17 CST 2022
Dear all,
I have coupled PETSc with my computational fluid dynamics (CFD) solver for
incompressible flows where the most computationally intensive part is a
solution of the linear system for pressure - which is singular.
A simple call to PETSc solvers resulted in divergence, as expected, but
things work when I set the null space for the pressure matrix as
demonstrated in src/ksp/ksp/tutorials/ex29.c:
MatNullSpace nullspace;
ierr =
MatNullSpaceCreate(PETSC_COMM_WORLD,PETSC_TRUE,0,0,&nullspace);CHKERRQ(ierr);
ierr = MatSetNullSpace(J,nullspace);CHKERRQ(ierr);
ierr = MatNullSpaceDestroy(&nullspace);CHKERRQ(ierr);
However, the effect of setting the null space as described above, has
almost the same effect (convergence history is almost the same) as if when
I multiply each diagonal of the system matrix with (1.0 + 1.0e-6), i.e.,
desingularize the matrix by making it slightly diagonally dominant.
I prefer the former solution as the latter one seems a bit like an ad-hoc
patch and I am not sure how general it is, but I wonder, from a
mathematical point of view, is it the same thing? Any thoughts on that?
Cheers,
Bojan Niceno
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220227/ae58b490/attachment.html>
More information about the petsc-users
mailing list