Re: [petsc-users] KSPBuildResidual in ex42.c
In src/ksp/ksp/examples/tutorials/ex42.c.html the Stokes system is solved and KSPBuildResidual is used to compute the residuals for the velocity components and pressure individually. Are these the preconditioned residuals or the true residuals?
The true residual.
And how to get both?
Precondition it.
Note that if you only want norms, GMRES will compute one (preconditioned by default).
Yes, only the norms. As I understand now, GMRES will compute the norm of the total system residual [U,V,W,P], but I would like the norms of [U], [V], [W] and [P] residuals separated. Based on ex42, I got the impression that I have to use KSPBuildResidual. dr. ir. Christiaan Klaij CFD Researcher Research & Development E mailto:[email protected] T +31 317 49 33 44 MARIN 2, Haagsteeg, P.O. Box 28, 6700 AA Wageningen, The Netherlands T +31 317 49 39 11, F +31 317 49 32 45, I www.marin.nl
On Tue, May 22, 2012 at 9:54 AM, Klaij, Christiaan <[email protected]> wrote:
Yes, only the norms. As I understand now, GMRES will compute the norm of the total system residual [U,V,W,P], but I would like the norms of [U], [V], [W] and [P] residuals separated. Based on ex42, I got the impression that I have to use KSPBuildResidual.
Yes, the cost of building the residual (check -log_summary to see how big it is) is a reason why people often avoid GMRES if they need the full residual. It's directly available with GCR, for example (which is otherwise similar in work to FGMRES) and with most of the non-residual-minimizing methods.
participants (2)
-
Jed Brown -
Klaij, Christiaan