[petsc-users] How to get total subsnes iterations

Matthew Knepley knepley at gmail.com
Wed Oct 12 10:14:59 CDT 2022


On Wed, Oct 12, 2022 at 11:04 AM Takahashi, Tadanaga <tt73 at njit.edu> wrote:

> Hi. I am using the snes nasm for the global solver and snes newtonls for
> the local subdomain solver. I am trying to get the total number of Newton
> iterations for just one subdomain. I've tried:
>
> SNESNASMGetSNES(snes,0,&subsnes);
> SNESSolve(snes,NULL,u_initial);
> SNESGetNumberFunctionEvals(subsnes,&Newt_its);
>

Here I think you want

  https://petsc.org/main/docs/manualpages/SNES/SNESGetIterationNumber/


> but this just gets me the number of Newton iterations just on the final
> nasm iteration. If I understand correctly, the information in the subsnes
> is repeatedly destroyed while the SNESSolve is running. Is there any way to
> extract the total subsnes iterations after the SNESSolve? If not, how would
> I extract the information?
>

You are correct. This is an oversight by us. We need to keep track of this
in the same way we track the number of linear iterations in SNES.
Can you submit an issue for this? I can do it in November.

  Thanks,

     Matt

-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20221012/ecc90973/attachment.html>


More information about the petsc-users mailing list