<div dir="ltr">Dear all,<div><br></div><div>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.</div><div><br></div><div>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 <font face="monospace">src/ksp/ksp/tutorials/ex29.c</font>:</div><div><font face="monospace">    MatNullSpace nullspace;<br>    ierr = MatNullSpaceCreate(PETSC_COMM_WORLD,PETSC_TRUE,0,0,&nullspace);CHKERRQ(ierr);</font></div><div><font face="monospace">    ierr = MatSetNullSpace(J,nullspace);CHKERRQ(ierr);<br>    ierr = MatNullSpaceDestroy(&nullspace);CHKERRQ(ierr);</font></div><div><br></div><div>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.</div><div><br></div><div>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?</div><div><br></div><div><br></div><div>    Cheers,</div><div><br></div><div>    Bojan Niceno</div></div>