intercepting residues as array

Jed Brown jed at 59A2.org
Fri Dec 11 13:42:29 CST 2009


On Fri, 11 Dec 2009 20:36:35 +0100, Dominik Szczerba <dominik at itis.ethz.ch> wrote:
> Would it be easy to intercept the rnorms as computed in e.g. fgmres into 
> an array? E.g. have
> 
>    0 KSP Residual norm 5.955965225039e-04
>    1 KSP Residual norm 8.064336982160e-05
>    2 KSP Residual norm 2.550695121313e-05
>    3 KSP Residual norm 7.872959324551e-06
>    4 KSP Residual norm 2.084257872716e-06
> 
> as {5.955965225039e-04, 8.064336982160e-05, ...} for independent logging 
> etc.
> 
> I know how I can do it the long way (e.g. writing my own convergence 
> test where I have an access to rnorm), but I was wondering if there was 
> a short way.

See KSPMonitorSet, ksp/ksp/examples/tutorials/ex9.c

Jed


More information about the petsc-users mailing list