[petsc-users] MatSetNullSpace
Bikash Kanungo
bikash at umich.edu
Thu Jun 1 14:07:51 CDT 2017
Hi,
I'm trying to solve a linear system of equations Ax=b, where A has a null
space (say Q) and x is known to be orthogonal to Q. In order to avoid
ill-conditioning, I was trying to do the following:
1. Create A as a shell matrix
2. Overload the MATOP_MULT operation for with my own function which
returns
y = A*(I - QQ^T)x instead of y = Ax
3. Upon convergence, solution = (I-QQ^T)x instead of x.
However, I realized that the linear solver can make x have any arbitrary
component along Q and still y = A*(I-QQ^T)x will remain unaffected, and
hence can cause convergence issues. Indeed, I saw such convergence
problems. What fixed the problem was using MatSetNullSpace for A with Q as
the nullspace, in addition to the above three steps.
So my question is what exactly is MatSetNullSpace doing? And since the full
A information is not present and A is only accessed through MAT_OP_MULT,
I'm confused as how MatSetNullSpace might be fixing the convergence issue.
Thanks,
Bikash
--
Bikash S. Kanungo
PhD Student
Computational Materials Physics Group
Mechanical Engineering
University of Michigan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170601/bba5df10/attachment.html>
More information about the petsc-users
mailing list