[petsc-users] KSPBuildResidual and KSPType compatibility
Fischer, Greg A.
fischega at westinghouse.com
Mon Dec 6 11:08:02 CST 2021
Quite different:
2-NORM(residualVec): 9802864883082.29
2-NORM(ksp): 6.802405785457120E-015
Perhaps I’m doing something else wrong?
From: Barry Smith <bsmith at petsc.dev>
Sent: Monday, December 6, 2021 11:58 AM
To: Fischer, Greg A. <fischega at westinghouse.com>
Cc: petsc-users at mcs.anl.gov
Subject: Re: [petsc-users] KSPBuildResidual and KSPType compatibility
[External Email]
This algorithm computes the residual norms indirectly (this is part of the "trick" of the algorithm to reduce the number of global reductions needed), thus they may not match the actual residual norm computed by || b - A x ||. How different are your values?
Barry
On Dec 6, 2021, at 11:19 AM, Fischer, Greg A. via petsc-users <petsc-users at mcs.anl.gov<mailto:petsc-users at mcs.anl.gov>> wrote:
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.
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).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20211206/346955f5/attachment-0001.html>
More information about the petsc-users
mailing list