<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, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Hi Jose,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Thanks for your reply.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
I have tried <font size="2"><span style="font-size:11pt">PetscCall(MatConvert(slepc_A_mf,MATDENSE,MAT_INITIAL_MATRIX,&Adense));</span></font> and If I do MatView(Adense,viewer), All I see was NAN. Have I missed anything here?</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Thanks,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Feng<br>
</div>
<div id="signature_bookmark"></div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,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> 24 August 2022 16:23<br>
<b>To:</b> feng wang <snailsoar@hotmail.com><br>
<b>Cc:</b> petsc-users <petsc-users@mcs.anl.gov><br>
<b>Subject:</b> Re: [petsc-users] Slepc Question, shell-matrix</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText"><br>
<br>
> El 24 ago 2022, a las 17:03, feng wang <snailsoar@hotmail.com> escribió:<br>
> <br>
> Hi Jose,<br>
> <br>
> Thanks for your reply.<br>
> <br>
> I have tried -eps_view_mat0 binary:amatrix.bin to save my shell matrix. It seems not saving the shell matrix and just created an empty file.<br>
<br>
Oops, I thought the shell matrix would be converted automatically. Try converting it yourself:<br>
<br>
PetscCall(MatConvert(slepc_A_mf,MATDENSE,MAT_INITIAL_MATRIX,&Adense));<br>
<br>
Then use Adense in EPSSetOperators(). Or save it to disk and send it to me so that I can give it a try.<br>
<br>
> <br>
> Besides, I am trying to understand the output of slepc. I can set -eps_tol to a low value, but the final relative residual norm is still high , what does this tell me?<br>
<br>
I don't know. It should not happen.<br>
Jose<br>
<br>
> <br>
> Best regards,<br>
> Feng<br>
> <br>
> From: Jose E. Roman <jroman@dsic.upv.es><br>
> Sent: 23 August 2022 11:06<br>
> To: feng wang <snailsoar@hotmail.com><br>
> Cc: petsc-users <petsc-users@mcs.anl.gov><br>
> Subject: Re: [petsc-users] Slepc Question, shell-matrix<br>
> <br>
> You can try the following. Save your shell matrix to disk with the option<br>
> -eps_view_mat0 binary:amatrix.bin<br>
> then repeat the computation with ex4.c loading this file.<br>
> <br>
> Note that this should be done for a small problem size, because the conversion from a shell matrix implies a matrix-vector product per each column.<br>
> <br>
> Jose<br>
> <br>
> > El 23 ago 2022, a las 12:57, feng wang <snailsoar@hotmail.com> escribió:<br>
> > <br>
> > Hi Jose,<br>
> > <br>
> > Thanks for your reply.<br>
> > <br>
> > It represents a linear operator. In my shell matrix, I am computing the non-linear residuals twice with perturbed flow variables. The matrix-vector product is computed as:<br>
> > <br>
> > A*v = (R(q+eps*v) - R(q-eps*v))/(2*eps)<br>
> > <br>
> > R is the non-linear residual. q is my flow variable and it does not change. eps is the perturbation. A is my Jacobian matrix. Besides, for some background, I am computing a steady RANS flow with finite volume method and trying to do a global stability analysis
by looking at the Jacobian matrix. <br>
> > <br>
> > Thanks,<br>
> > Feng<br>
> > <br>
> > From: Jose E. Roman <jroman@dsic.upv.es><br>
> > Sent: 23 August 2022 10:32<br>
> > To: feng wang <snailsoar@hotmail.com><br>
> > Cc: petsc-users <petsc-users@mcs.anl.gov><br>
> > Subject: Re: [petsc-users] Slepc Question, shell-matrix<br>
> > <br>
> > The relative residual norms that are printed at the end are too large. For NHEP problems, they should be below the tolerance. Don't know what is happening. Does your shell matrix represent a linear (constant) operator? Or does it change slightly depending
on the input vector? <br>
> > <br>
> > > El 23 ago 2022, a las 12:14, feng wang <snailsoar@hotmail.com> escribió:<br>
> > > <br>
> > > Hi Jose,<br>
> > > <br>
> > > I think the previous problem comes from my side. I have some uninitialized values in my part of code to compute the non-linear residuals. so, it produces a NAN when it tries to compute the matrix-vector product using finite difference. This might make
the slepc/pestc do unexpected things.<br>
> > > <br>
> > > Now It seems I've got slepc running. eps_nev is set to 3 and I am trying to compute the ones with the largest amplitudes. Below is the slepc output.
<br>
> > > <br>
> > > 14 EPS converged value (error) #0 -0.000164282 (5.36813206e-09)<br>
> > > 16 EPS converged value (error) #1 -0.000160691+2.17113e-05i (3.37429620e-09)<br>
> > > 16 EPS converged value (error) #2 -0.000160691-2.17113e-05i (3.37429620e-09)<br>
> > > Solution method: krylovschur<br>
> > > <br>
> > > Number of requested eigenvalues: 2<br>
> > > Linear eigensolve converged (3 eigenpairs) due to CONVERGED_TOL; iterations 16<br>
> > > ---------------------- --------------------<br>
> > > k ||Ax-kx||/||kx||<br>
> > > ---------------------- --------------------<br>
> > > -0.000164 0.0613788<br>
> > > -0.000161+0.000022i 0.0773339<br>
> > > -0.000161-0.000022i 0.0774536<br>
> > > ---------------------- --------------------<br>
> > > <br>
> > > The values in the brackets are the absolute error (I believe) and they seem very low. The relative error seems quite large. Could you please comment on this?
<br>
> > > <br>
> > > <br>
> > > Best regards,<br>
> > > Feng<br>
> > > <br>
> > > From: Jose E. Roman <jroman@dsic.upv.es><br>
> > > Sent: 23 August 2022 5:24<br>
> > > To: feng wang <snailsoar@hotmail.com><br>
> > > Cc: petsc-users <petsc-users@mcs.anl.gov><br>
> > > Subject: Re: [petsc-users] Slepc Question, shell-matrix<br>
> > > <br>
> > > Please always respond to the list, otherwise the thread appears as unresolved in the archives of the mailing list.<br>
> > > <br>
> > > <br>
> > > > El 22 ago 2022, a las 22:45, feng wang <snailsoar@hotmail.com> escribió:<br>
> > > > <br>
> > > > Hi Jose,<br>
> > > > <br>
> > > > I think I might have solved my problem. I have some uninitialized values in my part of code to compute the right hand side. so it produces a NAN when it tries to compute the matrix-vector product.
<br>
> > > > <br>
> > > > Many thanks for your help!<br>
> > > > <br>
> > > > Best regards,<br>
> > > > Feng<br>
> > > > From: Jose E. Roman <jroman@dsic.upv.es><br>
> > > > Sent: 22 August 2022 19:32<br>
> > > > To: feng wang <snailsoar@hotmail.com><br>
> > > > Cc: petsc-users@mcs.anl.gov <petsc-users@mcs.anl.gov><br>
> > > > Subject: Re: [petsc-users] Slepc Question, shell-matrix<br>
> > > > <br>
> > > > This is very strange. This error appears when the solver employs the B-inner product, but in your case you don't have a B matrix, so you should never see that error. Try running under valgrind to see if it gives more hints.<br>
> > > > <br>
> > > > Jose<br>
> > > > <br>
> > > > <br>
> > > > > El 22 ago 2022, a las 20:45, feng wang <snailsoar@hotmail.com> escribió:<br>
> > > > > <br>
> > > > > Hello,<br>
> > > > > <br>
> > > > > I am new to Slepc and trying to work out the eigenvalues and eigenvectors of my Jacobian matrix. I am using a shell matrix to work out the matrix-vector product and I am using the default Krylov-schur method.
<br>
> > > > > <br>
> > > > > My first attempt was not successful and I got the following errors:<br>
> > > > > <br>
> > > > > [0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br>
> > > > > [0]PETSC ERROR: Missing or incorrect user input <br>
> > > > > [0]PETSC ERROR: The inner product is not well defined: indefinite matrix<br>
> > > > > [0]PETSC ERROR: See <a href="https://petsc.org/release/faq/" data-auth="NotApplicable">
https://petsc.org/release/faq/</a> for trouble shooting.<br>
> > > > > [0]PETSC ERROR: Petsc Release Version 3.17.4, unknown <br>
> > > > > [0]PETSC ERROR: cfdtest on a arch-debug named ming by feng Mon Aug 22 19:21:41 2022<br>
> > > > > [0]PETSC ERROR: Configure options --with-cc=mpicc --with-cxx=mpicxx --with-fc=0 PETSC_ARCH=arch-debug<br>
> > > > > [0]PETSC ERROR: #1 BV_SafeSqrt() at /home/feng/cfd/slepc-3.17.1/include/slepc/private/bvimpl.h:130<br>
> > > > > [0]PETSC ERROR: #2 BV_SquareRoot_Default() at /home/feng/cfd/slepc-3.17.1/include/slepc/private/bvimpl.h:365<br>
> > > > > [0]PETSC ERROR: #3 BVOrthogonalizeCGS1() at /home/feng/cfd/slepc-3.17.1/src/sys/classes/bv/interface/bvorthog.c:101<br>
> > > > > [0]PETSC ERROR: #4 BVOrthogonalizeGS() at /home/feng/cfd/slepc-3.17.1/src/sys/classes/bv/interface/bvorthog.c:177<br>
> > > > > [0]PETSC ERROR: #5 BVOrthonormalizeColumn() at /home/feng/cfd/slepc-3.17.1/src/sys/classes/bv/interface/bvorthog.c:402<br>
> > > > > [0]PETSC ERROR: #6 BVMatArnoldi() at /home/feng/cfd/slepc-3.17.1/src/sys/classes/bv/interface/bvkrylov.c:91<br>
> > > > > [0]PETSC ERROR: #7 EPSSolve_KrylovSchur_Default() at /home/feng/cfd/slepc-3.17.1/src/eps/impls/krylov/krylovschur/krylovschur.c:261<br>
> > > > > [0]PETSC ERROR: #8 EPSSolve() at /home/feng/cfd/slepc-3.17.1/src/eps/interface/epssolve.c:147<br>
> > > > > [0]PETSC ERROR: #9 slepc_eigen_comp() at domain/cfd/slepc_eigen_solve.cpp:77<br>
> > > > > <br>
> > > > > Could someone please shine some light on this? I have also attached my code. The code is part of my big library and I cannot attach the whole code, sorry about this. but I am happy to provide more information. The attached code has some arrangements
for halo exchange, but for the moment, it assumes it is a serial run.<br>
> > > > > <br>
> > > > > Many thanks,<br>
> > > > > Feng<br>
> > > > > <slepc_eigen_solve.cpp><br>
<br>
</div>
</span></font></div>
</body>
</html>