With -pc_type none, my value matches the ksp value, but it no longer converges.
-----Original Message----- From: Jed Brown <j...@jedbrown.org> Sent: Monday, December 6, 2021 12:31 PM To: Fischer, Greg A. <fisch...@westinghouse.com>; Fischer, Greg A. via petsc-users <petsc-users@mcs.anl.gov>; petsc-users@mcs.anl.gov Cc: Fischer, Greg A. <fisch...@westinghouse.com> Subject: RE: [petsc-users] KSPBuildResidual and KSPType compatibility [External Email] Please try with -pc_type none. There is always a small difference due to using the recurrence, but it should be small so long as the Krylov basis is close to orthogonal. I'd note that if you're using this expensive convergence test, then IBCGS probably isn't helping over BCGS (the I part is to amortize some vector and reduction costs). It'd be worth comparing when you use normal BCGS. "Fischer, Greg A." <fisch...@westinghouse.com> writes: > I tried your suggestion, but the values are still quite different. > > -----Original Message----- > From: Jed Brown <j...@jedbrown.org> > Sent: Monday, December 6, 2021 12:01 PM > To: Fischer, Greg A. via petsc-users <petsc-users@mcs.anl.gov>; > petsc-users@mcs.anl.gov > Cc: Fischer, Greg A. <fisch...@westinghouse.com> > Subject: Re: [petsc-users] KSPBuildResidual and KSPType compatibility > > [External Email] > > "Fischer, Greg A. via petsc-users" <petsc-users@mcs.anl.gov> writes: > >> Hello petsc-users, >> >> I would like to check convergence against the infinity norm, so I defined my >> own convergence test routine with KSPSetConvergenceTest. (I understand that >> it may be computationally expensive.) >> >> I would like to do this with the "ibcgs" method. When I use KSPBuildResidual >> and calculate the NORM_2 against the output vector, I get a value that >> differs from the 2-norm that gets passed into the convergence test function. >> However, when I switch to the "gcr" method, the value I calculate matches >> the function input value. > > IBCGS uses the preconditioned norm by default while GCR uses the > unpreconditioned norm. You can use -ksp_norm_type unpreconditioned or > KSPSetNormType() to make IBCGS use unpreconditioned. > >> Is the KSPBuildResidual function only compatible with a subset of the >> KSPType methods? If I want to evaluate convergence against the infinity >> norm, do I need to set KSPSetInitialGuessNonzero and continually re-start >> the solver with a lower tolerance values until I get a satisfactory value of >> the infinity norm? >> >> Thanks, >> Greg >> >> >> ________________________________ >> >> This e-mail may contain proprietary information of the sending organization. >> Any unauthorized or improper disclosure, copying, distribution, or use of >> the contents of this e-mail and attached document(s) is prohibited. The >> information contained in this e-mail and attached document(s) is intended >> only for the personal and private use of the recipient(s) named above. If >> you have received this communication in error, please notify the sender >> immediately by email and delete the original e-mail and attached document(s). > > ________________________________ > > This e-mail may contain proprietary information of the sending organization. > Any unauthorized or improper disclosure, copying, distribution, or use of the > contents of this e-mail and attached document(s) is prohibited. The > information contained in this e-mail and attached document(s) is intended > only for the personal and private use of the recipient(s) named above. If you > have received this communication in error, please notify the sender > immediately by email and delete the original e-mail and attached document(s). ________________________________ This e-mail may contain proprietary information of the sending organization. Any unauthorized or improper disclosure, copying, distribution, or use of the contents of this e-mail and attached document(s) is prohibited. The information contained in this e-mail and attached document(s) is intended only for the personal and private use of the recipient(s) named above. If you have received this communication in error, please notify the sender immediately by email and delete the original e-mail and attached document(s).