Re: [petsc-users] Ksp Initial residual norm

2019-02-03 Thread Smith, Barry F. via petsc-users
Oh yes. Better than my suggestion since it requires no coding.\ Barry > On Feb 3, 2019, at 3:40 PM, Matthew Knepley wrote: > > On Sun, Feb 3, 2019 at 2:24 PM Smith, Barry F. via petsc-users > wrote: > > > > On Feb 3, 2019, at 1:16 PM, Edoardo alinovi > > wrote: > > > > Thank you v

Re: [petsc-users] Ksp Initial residual norm

2019-02-03 Thread Matthew Knepley via petsc-users
On Sun, Feb 3, 2019 at 2:24 PM Smith, Barry F. via petsc-users < petsc-users@mcs.anl.gov> wrote: > > > > On Feb 3, 2019, at 1:16 PM, Edoardo alinovi > wrote: > > > > Thank you very much Barry for the suggestion. > > > > Unfortunately, I am using Fortran and not C++ . Do you have an > equivalent t

Re: [petsc-users] Ksp Initial residual norm

2019-02-03 Thread Smith, Barry F. via petsc-users
> On Feb 3, 2019, at 1:16 PM, Edoardo alinovi wrote: > > Thank you very much Barry for the suggestion. > > Unfortunately, I am using Fortran and not C++ . Do you have an equivalent > trick in this case? :) You would need to provide this function as a C function (in its own little .c fi

Re: [petsc-users] Ksp Initial residual norm

2019-02-03 Thread Smith, Barry F. via petsc-users
If you use the default KSP convergence tests (which almost everyone does) the initial residual norm is stored in ksp->rnorm0. Thus to access it you need to include the private header file that defines the KSP object kspimpl.h so something like #include PetscErrorCode KSPGetInitialRe