[petsc-users] Incorrect Eigenvalues when Setting KSP and PC types

Greg Meyer gregory.meyer at gmail.com
Thu Sep 21 19:51:04 CDT 2017


Ok, thanks. It seems that PETSc clearly should throw an error in this case
instead of just giving incorrect answers? I am surprised that it does not
throw an error...

On Thu, Sep 21, 2017 at 5:24 PM Hong <hzhang at mcs.anl.gov> wrote:

> Greg :
>
>> Yes, they are Hermitian.
>>
>
> PETSc does not support  Cholesky factorization for Hermitian.
> It seems mumps does not support Hermitian either
>
> https://lists.mcs.anl.gov/mailman/htdig/petsc-users/2015-November/027541.html
>
> Hong
>
>
>> On Thu, Sep 21, 2017 at 3:43 PM Hong <hzhang at mcs.anl.gov> wrote:
>>
>>> Greg:
>>>
>>> OK, the difference is whether LU or Cholesky factorization is used. But
>>>> I would hope that neither one should give incorrect eigenvalues, and when I
>>>> run with the latter it does!
>>>>
>>> Are your matrices symmetric/Hermitian?
>>> Hong
>>>
>>>>
>>>> On Thu, Sep 21, 2017 at 2:05 PM Hong <hzhang at mcs.anl.gov> wrote:
>>>>
>>>>> Gregory :
>>>>> Use '-eps_view' for both runs to check the algorithms being used.
>>>>> Hong
>>>>>
>>>>> Hi all,
>>>>>>
>>>>>> I'm using shift-invert with EPS to solve for eigenvalues. I find that
>>>>>> if I do only
>>>>>>
>>>>>> ...
>>>>>>   ierr = EPSGetST(eps,&st);CHKERRQ(ierr);
>>>>>>   ierr = STSetType(st,STSINVERT);CHKERRQ(ierr);
>>>>>> ...
>>>>>>
>>>>>> in my code I get correct eigenvalues. But if I do
>>>>>>
>>>>>> ...
>>>>>>   ierr = EPSGetST(eps,&st);CHKERRQ(ierr);
>>>>>>   ierr = STSetType(st,STSINVERT);CHKERRQ(ierr);
>>>>>>   ierr = STGetKSP(st,&ksp);CHKERRQ(ierr);
>>>>>>   ierr = KSPGetPC(ksp,&pc);CHKERRQ(ierr);
>>>>>>   ierr = KSPSetType(ksp,KSPPREONLY);CHKERRQ(ierr);
>>>>>>   ierr = PCSetType(pc,PCCHOLESKY);CHKERRQ(ierr);
>>>>>> ...
>>>>>>
>>>>>> the eigenvalues found by EPS are completely wrong! Somehow I thought
>>>>>> I was supposed to do the latter, from the examples etc, but I guess that
>>>>>> was not correct? I attach the full piece of test code and a test matrix.
>>>>>>
>>>>>> Best,
>>>>>> Greg
>>>>>>
>>>>>
>>>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170922/88546162/attachment.html>


More information about the petsc-users mailing list