[petsc-dev] broken TS example related to Jacobian and coloring etc.

2012-08-15 Thread Peter Brune
U. OK. We should remove custom -fd arguments from every example first and use -snes_fd_coloring instead. The example problems should work with that and if they do not then we fix it. The context should always be owned elsewhere so if we manually unset it we should be fine. - Peter On Aug 15

[petsc-dev] broken TS example related to Jacobian and coloring etc.

2012-08-15 Thread Barry Smith
On Aug 15, 2012, at 1:03 AM, Jed Brown wrote: > On Tue, Aug 14, 2012 at 5:03 PM, Barry Smith wrote: > But you've just told me that ONLY ts is allowed to use the SNESSetJacobian() > context slot (coloring and presumably users) aren't allowed to. > > Not at all. I mean that coloring as produced

[petsc-dev] broken TS example related to Jacobian and coloring etc.

2012-08-15 Thread Jed Brown
On Wed, Aug 15, 2012 at 6:41 AM, Barry Smith wrote: > I think it uses null in order to delay computing the matrix coloring etc > from the time of SNESSetJacobian() to a later time. I guess what could > happen is it creates a n "empty" fdcoloring beast and passes that into > SNESSetJacobian() an

[petsc-dev] broken TS example related to Jacobian and coloring etc.

2012-08-15 Thread Jed Brown
On Tue, Aug 14, 2012 at 5:03 PM, Barry Smith wrote: > But you've just told me that ONLY ts is allowed to use the > SNESSetJacobian() context slot (coloring and presumably users) aren't > allowed to. Not at all. I mean that coloring as produced internally by SNES should not ascribe special meani

[petsc-dev] broken TS example related to Jacobian and coloring etc.

2012-08-14 Thread Barry Smith
On Aug 14, 2012, at 5:59 PM, Jed Brown wrote: > On Tue, Aug 14, 2012 at 4:51 PM, Barry Smith wrote: > How about just having a SNESSetTS()? > > Please no. But you've just told me that ONLY ts is allowed to use the SNESSetJacobian() context slot (coloring and presumably users) aren't allowe

[petsc-dev] broken TS example related to Jacobian and coloring etc.

2012-08-14 Thread Barry Smith
On Aug 14, 2012, at 5:58 PM, Jed Brown wrote: > On Tue, Aug 14, 2012 at 4:19 PM, Barry Smith wrote: > Ok, but then that context cannot be used for any other purpose because of > the possible conflict. Which means SNEScoloring thing must be changed. > >Why not use SNESSetApplicationContex

[petsc-dev] broken TS example related to Jacobian and coloring etc.

2012-08-14 Thread Barry Smith
On Aug 14, 2012, at 5:26 PM, Peter Brune wrote: > > On Tue, Aug 14, 2012 at 5:16 PM, Jed Brown wrote: > On Tue, Aug 14, 2012 at 3:56 PM, Peter Brune wrote: > Correct; the sheer amount of code using this convention makes it exceedingly > painful to fix. It would be much easier to alter our i

[petsc-dev] broken TS example related to Jacobian and coloring etc.

2012-08-14 Thread Peter Brune
On Tue, Aug 14, 2012 at 5:16 PM, Jed Brown wrote: > On Tue, Aug 14, 2012 at 3:56 PM, Peter Brune wrote: > >> Correct; the sheer amount of code using this convention makes it >> exceedingly painful to fix. It would be much easier to alter our >> internals. I'm *this* close to fugueing on TS esp

[petsc-dev] broken TS example related to Jacobian and coloring etc.

2012-08-14 Thread Barry Smith
On Aug 14, 2012, at 5:16 PM, Jed Brown wrote: > On Tue, Aug 14, 2012 at 3:56 PM, Peter Brune wrote: > Correct; the sheer amount of code using this convention makes it exceedingly > painful to fix. It would be much easier to alter our internals. I'm *this* > close to fugueing on TS especiall

[petsc-dev] broken TS example related to Jacobian and coloring etc.

2012-08-14 Thread Barry Smith
On Aug 14, 2012, at 5:06 PM, Peter Brune wrote: > On a related note, it seems that we have this wonky notion of different code > paths for the same thing, in which we have SNESSetApplicationContext, > DMSetApplicationContext, and then the ctx arguments to > SNESSetFunction/Jacobian/GS/Picard.

[petsc-dev] broken TS example related to Jacobian and coloring etc.

2012-08-14 Thread Peter Brune
On a related note, it seems that we have this wonky notion of different code paths for the same thing, in which we have SNESSetApplicationContext, DMSetApplicationContext, and then the ctx arguments to SNESSetFunction/Jacobian/GS/Picard. Perhaps we should clarify what is used for what, or remove s

[petsc-dev] broken TS example related to Jacobian and coloring etc.

2012-08-14 Thread Barry Smith
On Aug 14, 2012, at 4:49 PM, Matthew Knepley wrote: > On Tue, Aug 14, 2012 at 4:47 PM, Jed Brown wrote: > On Tue, Aug 14, 2012 at 3:44 PM, Matthew Knepley wrote: > You can, but the setter routines interpret NULL as "ignore", i.e. > > if (func) ctx->func = func; > > Does this make sense to an

[petsc-dev] broken TS example related to Jacobian and coloring etc.

2012-08-14 Thread Jed Brown
On Tue, Aug 14, 2012 at 4:51 PM, Barry Smith wrote: > How about just having a SNESSetTS()? Please no. -- next part -- An HTML attachment was scrubbed... URL:

[petsc-dev] broken TS example related to Jacobian and coloring etc.

2012-08-14 Thread Jed Brown
On Tue, Aug 14, 2012 at 4:19 PM, Barry Smith wrote: > Ok, but then that context cannot be used for any other purpose because of > the possible conflict. Which means SNEScoloring thing must be changed. > >Why not use SNESSetApplicationContext() to get the ts into SNES? > I don't mind this, b

[petsc-dev] broken TS example related to Jacobian and coloring etc.

2012-08-14 Thread Peter Brune
On Tue, Aug 14, 2012 at 4:47 PM, Jed Brown wrote: > On Tue, Aug 14, 2012 at 3:44 PM, Matthew Knepley wrote: > >> You can, but the setter routines interpret NULL as "ignore", i.e. >>> >>> if (func) ctx->func = func; >>> >> >> Does this make sense to anyone? Can we remove that if? > > > Then we wou

[petsc-dev] broken TS example related to Jacobian and coloring etc.

2012-08-14 Thread Matthew Knepley
On Tue, Aug 14, 2012 at 4:47 PM, Jed Brown wrote: > On Tue, Aug 14, 2012 at 3:44 PM, Matthew Knepley wrote: > >> You can, but the setter routines interpret NULL as "ignore", i.e. >>> >>> if (func) ctx->func = func; >>> >> >> Does this make sense to anyone? Can we remove that if? > > > Then we wou

[petsc-dev] broken TS example related to Jacobian and coloring etc.

2012-08-14 Thread Matthew Knepley
On Tue, Aug 14, 2012 at 4:40 PM, Jed Brown wrote: > On Tue, Aug 14, 2012 at 3:35 PM, Matthew Knepley wrote: > >> I guess I do not understand. What is the context set API? Why can't you >> pass NULL? > > > You can, but the setter routines interpret NULL as "ignore", i.e. > > if (func) ctx->func =

[petsc-dev] broken TS example related to Jacobian and coloring etc.

2012-08-14 Thread Peter Brune
You have one call to set the TS and SNES jacobian nested as: TSSetRHSJacobian(ts ..); SNESSetJacobian(snes, .. SNESTSComputeJacobian, (void *)ts); And then a subsequent and seemingly unrelated call to SNESSetJacobian(snes, .. .. SNESDefaultComputeJacobianColor, PETSC_NULL); (Where the last

[petsc-dev] broken TS example related to Jacobian and coloring etc.

2012-08-14 Thread Matthew Knepley
On Tue, Aug 14, 2012 at 4:28 PM, Peter Brune wrote: > This is a problem I've been harping on but should harp on more; It is > IMPOSSIBLE to reset the context on a lot of things to null after it's been > set. What's happening is that the context is being set as the TS object in > the previous set

[petsc-dev] broken TS example related to Jacobian and coloring etc.

2012-08-14 Thread Peter Brune
This is a problem I've been harping on but should harp on more; It is IMPOSSIBLE to reset the context on a lot of things to null after it's been set. What's happening is that the context is being set as the TS object in the previous setting of the SNES jacobian in TSSetRHSJacobian. Then, this cal

[petsc-dev] broken TS example related to Jacobian and coloring etc.

2012-08-14 Thread Jed Brown
On Tue, Aug 14, 2012 at 3:56 PM, Peter Brune wrote: > Correct; the sheer amount of code using this convention makes it > exceedingly painful to fix. It would be much easier to alter our > internals. I'm *this* close to fugueing on TS especially and removing all > PetscObjects from ctx arguments

[petsc-dev] broken TS example related to Jacobian and coloring etc.

2012-08-14 Thread Barry Smith
Things are still mighty fragile > [0]PETSC ERROR: - Error Message > > [0]PETSC ERROR: Invalid argument! > [0]PETSC ERROR: Wrong type of object: Parameter # 6! > [0]PETSC ERROR: >

[petsc-dev] broken TS example related to Jacobian and coloring etc.

2012-08-14 Thread Jed Brown
On Tue, Aug 14, 2012 at 3:44 PM, Matthew Knepley wrote: > You can, but the setter routines interpret NULL as "ignore", i.e. >> >> if (func) ctx->func = func; >> > > Does this make sense to anyone? Can we remove that if? Then we would have to revisit lots of locations and get the old value befor

[petsc-dev] broken TS example related to Jacobian and coloring etc.

2012-08-14 Thread Jed Brown
On Tue, Aug 14, 2012 at 3:35 PM, Matthew Knepley wrote: > I guess I do not understand. What is the context set API? Why can't you > pass NULL? You can, but the setter routines interpret NULL as "ignore", i.e. if (func) ctx->func = func; -- next part -- An HTML attachmen