<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Dear Jose,<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thank you for your answer.<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I tried MLU but it did not help. <br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I also tried to eliminate the null space of B, but I do not know it apriori, <br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
and at least to my knowledge of PETSC-SLEPC there is not an explicit way to find it</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
but to find all the 0 eigenvectors of B, which again it requires the inverse of B.
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I am solving similar small problems millions of times, and this works fine most of the time,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
but once in a while it fails with the same LU zero pivot exception.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
One thing I tried yesterday, and it seams to work all the times, <br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
is perturbing the diagonal of B of a small factor, += 1.0e-10 ||B||,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
but I do not know how theoretically it sounds with all these indeterminate eigenvalues,
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
maybe you have a clue on this.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Eugenio<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="Signature">
<div>
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div align="left"><font size="2">Eugenio Aulisa<br>
<br>
Department of Mathematics and Statistics,<br>
Texas Tech University<br>
Lubbock TX, 79409-1042 <br>
room: 226<br>
http://www.math.ttu.edu/~eaulisa/<br>
phone: (806) 834-6684<br>
fax: (806) 742-1112 <br>
<br>
<br>
</font></div>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> Jose E. Roman <jroman@dsic.upv.es><br>
<b>Sent:</b> Tuesday, July 7, 2020 11:01 AM<br>
<b>To:</b> Aulisa, Eugenio <Eugenio.Aulisa@ttu.edu><br>
<b>Cc:</b> petsc-users@mcs.anl.gov <petsc-users@mcs.anl.gov>; Kara, Erdi <Erdi.Kara@ttu.edu><br>
<b>Subject:</b> Re: [petsc-users] Help with generalized eigenvalue problem</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">I don't know what options you are using, shift-and-invert or not, which, target. Anyway, if A and B have a common null space, then A-sigma*B will always be singular, so the KSP solver will have to deal with a singular system.<br>
<br>
If you pass the nullspace vectors to the EPS solver via <a href="https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fslepc.upv.es%2Fdocumentation%2Fcurrent%2Fdocs%2Fmanualpages%2FEPS%2FEPSSetDeflationSpace.html&amp;data=02%7C01%7CEugenio.Aulisa%40ttu.edu%7C5b98b0c29ec246ed6c7908d8228f12bb%7C178a51bf8b2049ffb65556245d5c173c%7C0%7C0%7C637297345179456168&amp;sdata=dP0Hi2ZPRo6rYubPYRK%2FimS0fZKBV9%2BJy7N%2BtXS6b30%3D&amp;reserved=0">
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fslepc.upv.es%2Fdocumentation%2Fcurrent%2Fdocs%2Fmanualpages%2FEPS%2FEPSSetDeflationSpace.html&amp;data=02%7C01%7CEugenio.Aulisa%40ttu.edu%7C5b98b0c29ec246ed6c7908d8228f12bb%7C178a51bf8b2049ffb65556245d5c173c%7C0%7C0%7C637297345179456168&amp;sdata=dP0Hi2ZPRo6rYubPYRK%2FimS0fZKBV9%2BJy7N%2BtXS6b30%3D&amp;reserved=0</a>
 then these vectors will also be attached to the KSP solver. <br>
<br>
Also, since you have MUMPS, try adding<br>
 -st_pc_factor_mat_solver_type mumps <br>
(see section 3.4.1 of the SLEPc users manual). MUMPS should be quite robust with respect to singular linear systems.<br>
<br>
Jose<br>
<br>
<br>
> El 7 jul 2020, a las 17:40, Aulisa, Eugenio <Eugenio.Aulisa@ttu.edu> escribió:<br>
> <br>
> Can somebody help me figure it out the solver options for the attached generalized eigenvalue problem?<br>
> <br>
> A x = lambda B x <br>
> <br>
> where A and B have the same null space, with 5 zero eigenvalues.<br>
> <br>
> The only non indefinite eigenvalue should be 41.1892<br>
> <br>
> The problem is Hermite semi-positive so automatically slepc should purify it, but to be sure I added<br>
> <br>
> EPSSetPurify(eps, PETSC_TRUE);<br>
> <br>
> I guess with my non-solver-options slepc is still trying to do the inverse of the full<br>
> B matrix with an LU decomposition and gets zero pivot.<br>
> <br>
> This is what I get as a PETSC error Message<br>
> <br>
>  [0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br>
>    [0]PETSC ERROR: Zero pivot in LU factorization: <a href="https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.mcs.anl.gov%2Fpetsc%2Fdocumentation%2Ffaq.html%23zeropivot&amp;data=02%7C01%7CEugenio.Aulisa%40ttu.edu%7C5b98b0c29ec246ed6c7908d8228f12bb%7C178a51bf8b2049ffb65556245d5c173c%7C0%7C0%7C637297345179456168&amp;sdata=5JnAFaw%2B4SsXiMYji4FQFLoTZOpE8r7ggYWSH1Jqti0%3D&amp;reserved=0">
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.mcs.anl.gov%2Fpetsc%2Fdocumentation%2Ffaq.html%23zeropivot&amp;data=02%7C01%7CEugenio.Aulisa%40ttu.edu%7C5b98b0c29ec246ed6c7908d8228f12bb%7C178a51bf8b2049ffb65556245d5c173c%7C0%7C0%7C637297345179456168&amp;sdata=5JnAFaw%2B4SsXiMYji4FQFLoTZOpE8r7ggYWSH1Jqti0%3D&amp;reserved=0</a><br>
>    [0]PETSC ERROR: Bad LU factorization<br>
>    [0]PETSC ERROR: See <a href="https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.mcs.anl.gov%2Fpetsc%2Fdocumentation%2Ffaq.html&amp;data=02%7C01%7CEugenio.Aulisa%40ttu.edu%7C5b98b0c29ec246ed6c7908d8228f12bb%7C178a51bf8b2049ffb65556245d5c173c%7C0%7C0%7C637297345179456168&amp;sdata=HUax0aUTExvaWCeZFBty%2F7SZf3bRxPq0h3hwnhbDXwE%3D&amp;reserved=0">
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.mcs.anl.gov%2Fpetsc%2Fdocumentation%2Ffaq.html&amp;data=02%7C01%7CEugenio.Aulisa%40ttu.edu%7C5b98b0c29ec246ed6c7908d8228f12bb%7C178a51bf8b2049ffb65556245d5c173c%7C0%7C0%7C637297345179456168&amp;sdata=HUax0aUTExvaWCeZFBty%2F7SZf3bRxPq0h3hwnhbDXwE%3D&amp;reserved=0</a>
 for trouble shooting.<br>
>    [0]PETSC ERROR: Petsc Development GIT revision: v3.11.3-2263-gce77f2ed1a  GIT Date: 2019-09-26 13:31:14 -0500<br>
>    [0]PETSC ERROR: Nitsche_ex4a on a arch-linux2-c-opt named linux-8biu by eaulisa Tue Jul  7 10:17:55 2020<br>
>    [0]PETSC ERROR: Configure options --with-debugging=0 --with-x=1 COPTFLAGS="-O3 -march=native -mtune=native" CXXOPTFLAGS="-O3 -march=native -mtune=native" FOPTFLAGS="-O3 -march=native -mtune=native" --download-openmpi=1 --download-fblaslapack=1 --download-hdf5=1
 --download-metis=1 --download-parmetis=1 --with-shared-libraries=1 --download-blacs=1 --download-scalapack=1 --download-mumps=1 --download-suitesparse<br>
>    [0]PETSC ERROR: #1 MatLUFactor_SeqDense() line 633 in /home/eaulisa/software/petsc/src/mat/impls/dense/seq/dense.c<br>
>    [0]PETSC ERROR: #2 MatLUFactorNumeric_SeqDense() line 432 in /home/eaulisa/software/petsc/src/mat/impls/dense/seq/dense.c<br>
>    [0]PETSC ERROR: #3 MatLUFactorNumeric() line 3056 in /home/eaulisa/software/petsc/src/mat/interface/matrix.c<br>
>    [0]PETSC ERROR: #4 PCSetUp_LU() line 126 in /home/eaulisa/software/petsc/src/ksp/pc/impls/factor/lu/lu.c<br>
>    [0]PETSC ERROR: #5 PCSetUp() line 894 in /home/eaulisa/software/petsc/src/ksp/pc/interface/precon.c<br>
>    [0]PETSC ERROR: #6 KSPSetUp() line 377 in /home/eaulisa/software/petsc/src/ksp/ksp/interface/itfunc.c<br>
>    [0]PETSC ERROR: #7 STSetUp_Shift() line 119 in /home/eaulisa/software/slepc/src/sys/classes/st/impls/shift/shift.c<br>
>    [0]PETSC ERROR: #8 STSetUp() line 271 in /home/eaulisa/software/slepc/src/sys/classes/st/interface/stsolve.c<br>
>    [0]PETSC ERROR: #9 EPSSetUp() line 273 in /home/eaulisa/software/slepc/src/eps/interface/epssetup.c<br>
>    [0]PETSC ERROR: #10 EPSSolve() line 136 in /home/eaulisa/software/slepc/src/eps/interface/epssolve.c<br>
> <br>
> <br>
> <br>
> Thanks<br>
> Eugenio<br>
> <br>
> <br>
> <br>
> <br>
> Eugenio Aulisa<br>
> <br>
> Department of Mathematics and Statistics,<br>
> Texas Tech University<br>
> Lubbock TX, 79409-1042 <br>
> room: 226<br>
> <a href="http://www.math.ttu.edu/~eaulisa/">http://www.math.ttu.edu/~eaulisa/</a><br>
> phone: (806) 834-6684<br>
> fax: (806) 742-1112 <br>
> <br>
> <br>
> <br>
> <genEigen.cpp><br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>