[petsc-users] Finding NullSpaces of Jacobian and TransposeJacobian

Ali Berk Kahraman aliberkkahraman at yahoo.com
Thu Apr 12 14:50:33 CDT 2018


In the very first e-mail, I have a scheme at hand. But sometimes it 
works, sometimes it does not. I have tried KSPLSQR with PCSOR, and it 
diverged with DIVERGED_BREAKDOWN where GMRES with PCSOR converges.

When I tried it without going through the scheme in the first e-mail, 
again with PCSOR and default parallel PC, it diverged again with 
DIVERGED_BREAKDOWN.

Thank you very much for your interest so far.

Ali


On 12-04-2018 21:33, Smith, Barry F. wrote:
>    Unfortunately I don't have a good answer for you.
>
>    The manual page for KSPCGNE says one should use KSPLSQR for least squares problems. This one hopefully has the correct convergence test for inconsistent systems built in. Please try this solver and let us know how it goes.
>
>     Barry
>
>
>
>> On Apr 12, 2018, at 11:13 AM, Ali Berk Kahraman <aliberkkahraman at yahoo.com> wrote:
>>
>> That was I was trying to ask, sorry for my vagueness. What kind of a convergence test should I conduct? Correct me if I am mistaken, the KSP object compares the current residual norm with iteration 0. If it reaches rtol, it declares convergence. What should I do to make it compare the residual norm with the previous iteration, and not iteration 0?
>>
>> On 12-04-2018 19:00, Smith, Barry F. wrote:
>>>> On Apr 12, 2018, at 10:56 AM, Ali Berk Kahraman <aliberkkahraman at yahoo.com> wrote:
>>>>
>>>> How do I tell that to the KSP object? Is there a direct command or a function?
>>>      Tell the KSP object what?
>>>
>>>      What happens when you run with -ksp_monitor_true_residual ?
>>>
>>>      We may not have a good convergence test for this case, since the default convergence test wants a residual norm near 0.
>>>
>>>     Barry
>>>
>>>> On 12-04-2018 18:54, Smith, Barry F. wrote:
>>>>>> On Apr 12, 2018, at 10:43 AM, Ali Berk Kahraman <aliberkkahraman at yahoo.com> wrote:
>>>>>>
>>>>>> Dear Barry,
>>>>>>
>>>>>> Thank you very very much for your response.
>>>>>>
>>>>>> Unfortunately, I use finite differences on an unstructured grid, so my matrix is not symmetric.
>>>>>>
>>>>>> That is exactly why I want to know the null space, so I can remove it from the RHS vector. Or as I understand it from the online documentation, so petsc can solve a least-squares problem using a MatNullSpace object. You suggestion should also work. I am fine with all of these methods. The problem is, I still have to know the left null space, or its norm in your suggestion, to use these methods.
>>>>>     I don't think you need to know the null space. As I said, just run GMRES until the residual norm becomes fixed (but non-zero) and you have your solution. No need to remove the transpose null space from the right hand side initially.
>>>>>
>>>>>      Barry
>>>>>
>>>>>> On 12-04-2018 17:37, Smith, Barry F. wrote:
>>>>>>>     A few thoughts,
>>>>>>>
>>>>>>>
>>>>>>>> On Apr 12, 2018, at 7:47 AM, Ali Berk Kahraman <aliberkkahraman at yahoo.com> wrote:
>>>>>>>>
>>>>>>>> Dear All,
>>>>>>>>
>>>>>>>> I am trying to solve a Poisson problem with a known source function with all Neumann BCs.
>>>>>>>     If you are using finite elements then the matrix should be symmetric and hence its transpose nullspace is the same as the original matrix.
>>>>>>>
>>>>>>>     Presumably you want to know the transpose null space so you can remove it from the right hand side to get a consistent linear system? With
>>>>>>> GMRES you don't need to actually remove it from the right hand side. Just apply GMRES to the inconsistent system, what will happen, if you
>>>>>>> use a good preconditioner is that GMRES will converge to a solution that minimizes the residual. So the residual norm will not be zero but the solution to GMRES is a valid solution to the linear system. In fact the "left over" residual will be in the null space of the transpose; in your case it will be the null space (since it is one dimensional).
>>>>>>>
>>>>>>>     Barry
>>>>>>>
>>>>>>>
>>>>>>>> Hence, I know that my problem does not always have a solution, at those times it has a transpose nullspace of one vector. If I know that vector, I can inform petsc of its existence using a MatNullSpace object.
>>>>>>>>
>>>>>>>> Currently, I am trying to find the nullspace vector by solving a linear system where TrJacobian*nullvec = e, but an arbitrary row of the TrJacobian (ith row) is replaced with all zeros except for the ith column, and every entry of e is 0 except for the ith entry which is 1. However, sometimes the KSP that solves this either does not converge, or even if it converges the nullvec it creates does not help with the original problem's ksp.
>>>>>>>>
>>>>>>>> Is there a more reliable way to find the transpose nullspace of a matrix?
>>>>>>>>
>>>>>>>> Best Regards,
>>>>>>>>
>>>>>>>> Ali Berk Kahraman
>>>>>>>> M.Sc. Student, Mechanical Eng.
>>>>>>>> Bogazici Uni. Istanbul, Turkey
>>>>>>>>



More information about the petsc-users mailing list