Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-15 Thread Jed Brown
Ed Bueler writes: > Jed -- > >> My point was that including sliding potentially adds another >> stiff/algebraic term so whatever interface we choose better be able to >> support at least two stiff terms. > > Yes, totally agreed w.r.t. the interface design. (The DAE that you

Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-15 Thread Ed Bueler
Jed -- > My point was that including sliding potentially adds another > stiff/algebraic term so whatever interface we choose better be able to > support at least two stiff terms. Yes, totally agreed w.r.t. the interface design. (The DAE that you are solving in that case is stiff.) However,

Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-15 Thread Jed Brown
Ed Bueler writes: > Jed -- > >>> u_t - div (u^k |grad u|^{p-2} grad u) = g(t,u) >>Are you also interested in the case with sliding? > > You must be getting grumpy. There is this 2009 paper about sliding ... > Yes I am interested in sliding but I was trying to keep things

Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-15 Thread Barry Smith
> On Feb 14, 2017, at 11:59 PM, Emil Constantinescu > wrote: > > We seem to be needing more than two components and ways to pack them. > Allowing them to be dynamically assigned at run time would be really cool. > > We seem to like an API that allows us to specify M and

Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-14 Thread Emil Constantinescu
We seem to be needing more than two components and ways to pack them. Allowing them to be dynamically assigned at run time would be really cool. We seem to like an API that allows us to specify M and u_t; but would also like to keep support for f(t,u,u_t)=0. How about a costly experiment:

Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-14 Thread Ed Bueler
> Jed suggested having any number of "RHS" functions. I don't think we need more than 2, 1 for left hand side > and 1 for right. If that ends up being not enough we can change to have any number of them. Just to be clear. > I suggest three functions > IFunction which defaults to u_t plus

Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-14 Thread Ed Bueler
Jed -- >> u_t - div (u^k |grad u|^{p-2} grad u) = g(t,u) >Are you also interested in the case with sliding? You must be getting grumpy. There is this 2009 paper about sliding ... Yes I am interested in sliding but I was trying to keep things simple for you. ;-) The code in question is an

Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-14 Thread Jed Brown
"Zhang, Hong" writes: > It is a great idea to require IFunction to be M u_t or u_t. This > allows us to eliminate the weird 'shift' parameter in the current > interface. Noo! That would prevent solving problems with moving meshes or with transient statements written in

Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-14 Thread Zhang, Hong
On Feb 14, 2017, at 9:20 PM, Barry Smith > wrote: On Feb 14, 2017, at 8:56 PM, Emil Constantinescu > wrote: On 2/14/17 4:10 PM, Barry Smith wrote: Ok, you don't recompile but forcing that into

Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-14 Thread Jed Brown
Barry Smith writes: >> On Feb 14, 2017, at 9:36 PM, Jed Brown wrote: >> 1. fluid splitting to isolate the acoustic wave (stiff) >> >> 2. fluid containing everything but the acoustic wave (non-stiff) >> >> 3. fast reactions >> >> 4. slow reactions >> >>

Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-14 Thread Barry Smith
> On Feb 14, 2017, at 9:56 PM, Jed Brown wrote: > > Ed Bueler writes: >> Your question makes me think about why I am splitting the way I am. For >> sure *yes*, in my case they are separate terms and *no* I am not just >> subtracting Lu from both sides.

Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-14 Thread Jed Brown
Ed Bueler writes: > Your question makes me think about why I am splitting the way I am. For > sure *yes*, in my case they are separate terms and *no* I am not just > subtracting Lu from both sides. > > The ice sheet thickness problem (u(t,x,y) >= 0 is thickness) is like >

Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-14 Thread Barry Smith
> On Feb 14, 2017, at 9:36 PM, Jed Brown wrote: > > Barry Smith writes: > >> The function below absolutely should not be called TSComputeIFunction()! It >> does not just compute IFunction() > > How is this different than SNESComputeFunction subtracting

Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-14 Thread Jed Brown
Barry Smith writes: > The function below absolutely should not be called TSComputeIFunction()! It > does not just compute IFunction() How is this different than SNESComputeFunction subtracting off the RHS? > The current code entangles too much of the user API to the

Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-14 Thread Barry Smith
> On Feb 14, 2017, at 8:56 PM, Emil Constantinescu wrote: > > On 2/14/17 4:10 PM, Barry Smith wrote: >> Ok, you don't recompile but forcing that into user code is still >> disgusting. With my api the user code is >> > TSSetRHSFunction(ts,NULL,RHSFunction,[0]);

Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-14 Thread Emil Constantinescu
On 2/14/17 4:10 PM, Barry Smith wrote: Ok, you don't recompile but forcing that into user code is still disgusting. With my api the user code is TSSetRHSFunction(ts,NULL,RHSFunction,[0]); TSSetLHSFunction(ts,NULL,LHSFunction,[0]); TSSetRHSJacobian(ts,Jac,Jac,RHSJacobian,[0]);

Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-14 Thread Ed Bueler
Jed -- > Yup, this is the form I have, > >u_t - f(u) = g(u) > Are these really separate terms? As I mentioned, a very common case is > to write > u_t - L u = f(u) - L u > where L is some stiff part of the operator (linear or non). This is > common for stiff waves in fluid problems or

Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-14 Thread Barry Smith
> On Feb 14, 2017, at 3:18 PM, Emil Constantinescu wrote: > > > > On 2/14/17 3:04 PM, Barry Smith wrote: >> >>> On Feb 14, 2017, at 2:55 PM, Emil Constantinescu >>> wrote: >>> >>> On 2/14/17 2:33 PM, Zhang, Hong wrote: I think many users

Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-14 Thread Emil Constantinescu
On 2/14/17 3:04 PM, Barry Smith wrote: On Feb 14, 2017, at 2:55 PM, Emil Constantinescu wrote: On 2/14/17 2:33 PM, Zhang, Hong wrote: I think many users (including me) would like to start with academic examples, e.g. u_t=f(u)+g(u), when they try to learn PETSc TS

Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-14 Thread Barry Smith
> On Feb 14, 2017, at 2:55 PM, Emil Constantinescu wrote: > > On 2/14/17 2:33 PM, Zhang, Hong wrote: >> I think many users (including me) would like to start with academic >> examples, e.g. u_t=f(u)+g(u), when they try to learn PETSc TS solvers. This >> simple form

Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-14 Thread Jed Brown
Criminy, that's disgusting. You implement options -term1 rhs -term2 lhs ... In your FormIFunction: if (term1 == LHS) { ... } and similarly in your FormRHSFunction. On February 14, 2017 1:55:42 PM MST, Emil Constantinescu wrote: >On 2/14/17 2:33 PM, Zhang, Hong wrote:

Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-14 Thread Emil Constantinescu
On 2/14/17 2:33 PM, Zhang, Hong wrote: I think many users (including me) would like to start with academic examples, e.g. u_t=f(u)+g(u), when they try to learn PETSc TS solvers. This simple form allows for easy switch between all kinds of different integration methods. Right, but then you

Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-14 Thread Zhang, Hong
I think many users (including me) would like to start with academic examples, e.g. u_t=f(u)+g(u), when they try to learn PETSc TS solvers. This simple form allows for easy switch between all kinds of different integration methods. Experienced users or experts who need to solve DAEs or

Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-14 Thread Barry Smith
I think > u_t = f(u) + g(u) where one wishes to switch from fully implicit to imex to fully explicit (with a likely small time-step constraint) is common enough that we should support it (we don't currently). The reason is that users may not know which form they should use and the

Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-14 Thread Jed Brown
Barry Smith writes: > Hence my suggestion to have TSSetLeftHandSideFunction() (or Jed's > suggestion to have multiple Right Hand side functions) this will allow > comparison of implicit, explicit, imex without recompiling (which we don't > have currently) for the case

Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-14 Thread Barry Smith
> On Feb 14, 2017, at 6:53 AM, Matthew Knepley wrote: > > On Mon, Feb 13, 2017 at 3:59 PM, Zhang, Hong wrote: > >> On Feb 13, 2017, at 3:08 PM, Ed Bueler wrote: >> >> Barry -- >> >> > Sounds like a bug to me. The methods should

Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-14 Thread Jed Brown
Matthew Knepley writes: > I see that is it not one-to-one, but its a pattern I think a lot of people > will want, and one of the most common > things people ask is "when does implicit beat explicit?". We should think > about ways to make this easier. Note that one of the most

Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-14 Thread Matthew Knepley
On Tue, Feb 14, 2017 at 8:55 AM, Emil Constantinescu wrote: > On 2/14/17 6:53 AM, Matthew Knepley wrote: > >> >> Explicit methods use only RHSFunction and ignore IFunction, so in >> your case, if you change TS type to rk and ssp at run time, you are >> actually

Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-14 Thread Emil Constantinescu
On 2/14/17 6:53 AM, Matthew Knepley wrote: Explicit methods use only RHSFunction and ignore IFunction, so in your case, if you change TS type to rk and ssp at run time, you are actually solving u_t = G(t,u). If RHSFunction is not provided, PETSc will assume the RHS is zero

Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-14 Thread Matthew Knepley
On Mon, Feb 13, 2017 at 3:59 PM, Zhang, Hong wrote: > > On Feb 13, 2017, at 3:08 PM, Ed Bueler wrote: > > Barry -- > > > Sounds like a bug to me. The methods should be checking if an > > IFunction is being provided and error out in that case. > > I

Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-13 Thread Zhang, Hong
On Feb 13, 2017, at 3:08 PM, Ed Bueler > wrote: Barry -- > Sounds like a bug to me. The methods should be checking if an > IFunction is being provided and error out in that case. I don't think it is that simple. I.e. having an IFunction and

Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-13 Thread Barry Smith
> On Feb 13, 2017, at 3:08 PM, Ed Bueler wrote: > > Barry -- > > > Sounds like a bug to me. The methods should be checking if an > > IFunction is being provided and error out in that case. > > I don't think it is that simple. I.e. having an IFunction and an explicit >

Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-13 Thread Ed Bueler
Barry -- > Sounds like a bug to me. The methods should be checking if an > IFunction is being provided and error out in that case. I don't think it is that simple. I.e. having an IFunction and an explicit scheme is not, by itself, a bug. I think. If the user has provided IFunction

Re: [petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-13 Thread Barry Smith
> On Feb 13, 2017, at 1:53 PM, Ed Bueler wrote: > > Dear Petsc -- > > This is the first of two short TS usage questions. > > My problem is both stiff (diffusive PDE) and constrained, so I require > >-snes_type vinewton{rs|ss}ls > > *and* I split my ODE system into

[petsc-users] TS question 1: how to stop explicit methods because they do not use SNES(VI)?

2017-02-13 Thread Ed Bueler
Dear Petsc -- This is the first of two short TS usage questions. My problem is both stiff (diffusive PDE) and constrained, so I require -snes_type vinewton{rs|ss}ls *and* I split my ODE system into IFunction and RHSFunction F(t,u,u_t) = G(t,u) where F(t,u,u_t) = u_t + f(t,u) in my case