Hello Matt

I want to get the first residual norm within my code to decide on
convergence.

I am solving a steady state problem with pseudo-timestepping and SNES.

Currently I am calling my FormFunction before call to SNES and using
VecNorm.

while(res_norm > res_tol)
{
uold = u;
FormFunction(snes,u,r,&ctx);
VecNorm(u,NORM_2,&res_norm);
SNESSolve(snes,NULL,u);
}

But this leads to a duplication of function evaluation.

What I want is something like this

while(res_norm > res_tol)
{
uold = u;
SNESSolve(snes,NULL,u);
// get res_norm = first residual of SNES
}

Best
praveen

On Mon, Sep 25, 2017 at 6:31 PM, Matthew Knepley <[email protected]> wrote:

> Does -snes_monitor not give that?
>
>   Thanks,
>
>      Matt
>
> On Mon, Sep 25, 2017 at 8:32 AM, Praveen C <[email protected]> wrote:
>
>> Dear all
>>
>> Is there a way to get the residual in first step of SNES ?
>>
>> Thanks
>> praveen
>>
>
>
>
> --
> 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.caam.rice.edu/~mk51/>
>

Reply via email to