On Jun 7, 2024, at 10:53 PM, neil liu <liufield@gmail.com> wrote:Thanks a lot for your explanation.Could you please share your petsc code to test this ?Thanks,XiaodongOn Fri, Jun 7, 2024 at 10:12 PM Barry Smith <bsmith@petsc.dev> wrote:If I run with -pc_type lu it solves the systemIf I run with the default (ILU) -ksp_monitor_true_residual -ksp_converged_reason it does not converge. In fact, it makes no real progress to the solution.It is always important to use KSPGetConvergedReason() or -ksp_converged_reason or -ksp_error_if_not_converged to check that the solver has actually converged.If I run with -ksp_gmres_restart 100 it converges in 75 iterations.BarryOn Jun 7, 2024, at 8:03 PM, neil liu <liufield@gmail.com> wrote:This Message Is From an External SenderThis message came from outside your organization.<A.m><xPetsc.m><B.m>Dear Petsc developers,I am using Petsc to solve a complex system ,AX=B.A is complex and B is real.And the petsc was configured withConfigure options --download-mpich --download-fblaslapack=1 --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-triangle --with-scalar-type=complexA and B were also imported to matlab and the same system was solved.The direct and iterative solver in matlab give the same result, which are quite different from the result from Petsc.A and B are attached. x from petsc is also attached. I am using only one processor.It is weird.Thanks a lot.Xiaodong