<div dir="ltr">Dear all,<div><br></div><div>I am dealing with a situation I was hoping to get some suggestions here. Suppose after discretizing a poisson equation with purely neumann (or periodic) bc I end up with a matrix that is *almost* symmetric, i.e. it is symmetric for almost all grid points with the exception of a few points.</div><div><br></div><div>The correct way of handling this problem is by specifying the nullspace to MatSetNullSpace. However, since the matrix is non-symmetric in general I would need to pass the nullspace of A^T. Now it turns out that if A is *sufficiently close to being symmetric*, I can get away with the constant vector, which is the nullspace of A and not A^T, but obviously this does not always work. Sometimes the KSP converges and in other situations the residual stagnates which is to be expected.</div><div><br></div><div>Now, here are my questions (sorry if they are too many!):</div><div> </div><div>1) Is there any efficient way of calculating nullspace of A^T in this case? Is SVD the only way?</div><div><br></div><div>2) I have tried fixing the solution at an arbitrary point, and while it generally works, for some problems I get numerical artifacts, e.g. slight asymmetry in the solution and/or increased error close to the point where I fix the solution. Is this, more or less, expected as a known artifact?</div><div><br></div><div>3) An alternative to 2 is to enforce some global constraint on the solution, e.g. to require that the average be zero. My question here is two-fold:</div><div><br></div><div>3-1) Is this generally any better than solution 2, in terms of not messing too much with the condition number of the matrix?</div><div><br></div><div>3-2) I don't quite know how to implement this using PETSc. Generally speaking I'd like to solve</div><div><br></div><div><font face="monospace, monospace">| A        U |   | X |   | B |</font></div><div><font face="monospace, monospace">|            | * |   | = |   |</font></div><div><font face="monospace, monospace">| U^T      0 |   | s |   | 0 |</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"><br></font></div><div><font face="arial, helvetica, sans-serif">where U is a constant vector (of ones) and s is effectively a Lagrange multiplier. I suspect I need to use </font>MatCreateSchurComplement and pass that to the KSP? Or do I need create my own matrix type from scratch through MatCreateShell?</div><div><br></div><div>Any help is appreciated!</div><div><br></div><div>Thanks,</div><div>Mohammad</div><div><br></div><div><br></div></div>