Dmitry Karpeyev <[email protected]> writes: > Yes. How should EW version 3 be implemented then? Currently EW3 > piggybacks on snes->ttol to get a measure of the initial norm of the > residual, and relies on it having been set elsewhere. If no > references to snes->ttol in SNESKSPEW_PreSolve() are allowed, what > should take its place?
I would say that EW3 should call VecNorm() on the first iteration. Vecs cache their norms internally so this will only do one reduction, even if the SNES convergence test calls VecNorm() itself. > I was just thinking of a single cache for the initial residual norm. > Currently there are at least two, it seems to me. Well, snes->norm_init is currently serving a different purpose, but it's not entirely clear that it needs to be set. In particular, do we ever compute a norm using a side channel rather than by calling VecNorm, possibly followed by VecCopy? If not, isn't calling SNESSetInitialFunction enough? SNES can just call VecNorm on F and it'll use the cached value if it was set.
pgpAXvmZmOUxg.pgp
Description: PGP signature
