Re: [petsc-users] SNES norm control

2016-01-12 Thread Barry Smith
> On Jan 12, 2016, at 8:19 PM, Gideon Simpson wrote: > > Got it. I’m trying to build up my desired convergence test, based on the > default routine. I’m getting the following compiler error, which I don’t > entirely understand: > > blowup_utils.c:180:9: error: >

Re: [petsc-users] SNES norm control

2016-01-12 Thread Dave May
On 12 January 2016 at 14:14, Gideon Simpson wrote: > That seems to to allow for me to cook up a convergence test in terms of > the 2 norm. > While you are only provided the 2 norm of F, you are also given access to the SNES object. Thus inside your user convergence

Re: [petsc-users] SNES norm control

2016-01-12 Thread Barry Smith
> On Jan 12, 2016, at 7:14 AM, Gideon Simpson wrote: > > That seems to to allow for me to cook up a convergence test in terms of the 2 > norm. No, why just the two norm? You can put whatever tests you want into your convergence test, including looking at

Re: [petsc-users] SNES norm control

2016-01-12 Thread Gideon Simpson
I’m just a bit confused by the documentation for SNESConvergenceTestFunction. the arguments for the xnorm, gnorm, and f are passed in, at the current iterate, correct? I interpreted this as though I had to build by convergence test based on those values. -gideon > On Jan 12, 2016, at 8:24

Re: [petsc-users] SNES norm control

2016-01-12 Thread Dave May
On 12 January 2016 at 14:33, Gideon Simpson wrote: > I’m just a bit confused by the documentation > for SNESConvergenceTestFunction. the arguments for the xnorm, gnorm, and f > are passed in, at the current iterate, correct? > Yes, but nothing requires you to use them

Re: [petsc-users] SNES norm control

2016-01-12 Thread gideon . simpson
Do I have to manually code in the divergence criteria too? > On Jan 12, 2016, at 8:37 AM, Dave May wrote: > > > >> On 12 January 2016 at 14:33, Gideon Simpson wrote: >> I’m just a bit confused by the documentation for >>

Re: [petsc-users] SNES norm control

2016-01-12 Thread Dave May
On 12 January 2016 at 15:06, wrote: > Do I have to manually code in the divergence criteria too? > Yes. By calling SNESSetConvergenceTest() you are replacing the default SNES convergence test function which will get called at each SNES iteration, therefore you are

Re: [petsc-users] SNES norm control

2016-01-12 Thread Gideon Simpson
That seems to to allow for me to cook up a convergence test in terms of the 2 norm. What I’m really looking for is the ability to change things to be something like the 2 norm of the vector with elements F_i/|x_i| where I am looking for a root of F(x). I can just build that scaling into the

Re: [petsc-users] SNES norm control

2016-01-12 Thread Gideon Simpson
Got it. I’m trying to build up my desired convergence test, based on the default routine. I’m getting the following compiler error, which I don’t entirely understand: blowup_utils.c:180:9: error: incomplete definition of type 'struct _p_SNES' snes->ttol = fnorm_scaled*snes->rtol;

Re: [petsc-users] SNES norm control

2016-01-11 Thread Barry Smith
You can use SNESSetConvergenceTest() to use whatever test you want to decide on convergence. Barry > On Jan 11, 2016, at 3:26 PM, Gideon Simpson wrote: > > I’m solving nonlinear problem for a complex valued function which is > decomposed into real and imaginary

[petsc-users] SNES norm control

2016-01-11 Thread Gideon Simpson
I’m solving nonlinear problem for a complex valued function which is decomposed into real and imaginary parts, Q = u + i v. What I’m finding is that where |Q| is small, the numerical phase errors tend to be larger. I suspect this is because it’s using the 2-norm for convergence in the SNES,