Not sure I understand the question but if you use '-ksp_type richardson' then you get a convergence check. Then you might say '-ksp_rtol 1e-1 -ksp_max_it 1' just to check if it failed with convered _reason. Just requires one residual calculation.
Mark On Wed, Jul 10, 2024 at 5:02 PM Chris Hewson <ch...@resfrac.com> wrote: > Hi There, We have a matrix that is singular and trying to solve it. We > first use an iterative solve with KSPBCGS, the solution vector is nan > values and the converged reason from PETSc of KSP_DIVERGED_NANORINF, that's > great and what I would > ZjQcmQRYFpfptBannerStart > This Message Is From an External Sender > This message came from outside your organization. > > ZjQcmQRYFpfptBannerEnd > Hi There, > > We have a matrix that is singular and trying to solve it. We first use an > iterative solve with KSPBCGS, the solution vector is nan values and the > converged reason from PETSc of KSP_DIVERGED_NANORINF, that's great and what > I would expect. > > Sometimes in our program we redo a failed solve using the MKL Pardiso > solver, when the same matrix and vectors get put into that solver which is > a KSPPREONLY, I get KSP_CONVERGED_ITS as a converged reason and solution > vector with nan values in it. > > Stepping through the PETSc calls, I see that the external call to Pardiso > doesn't return an error for this, so not really the fault of PETSc, but > curious if y'all have seen this before or a solution/workaround to this? > > *Chris Hewson* > Senior Reservoir Simulation Engineer > ResFrac > +1.587.575.9792 >