Re: [petsc-users] TimeStepper norm problems. EMIL Please read this

2015-04-16 Thread Emil Constantinescu
On 4/16/15 9:25 AM, Lisandro Dalcin wrote: On 16 April 2015 at 16:44, Emil Constantinescu wrote: On 4/16/15 2:13 AM, Lisandro Dalcin wrote: On 16 April 2015 at 04:51, Emil Constantinescu wrote: On 3/24/15 5:31 AM, Lisandro Dalcin wrote: Emil, is there any chance you can try my code wit

Re: [petsc-users] TimeStepper norm problems. EMIL Please read this

2015-04-16 Thread Lisandro Dalcin
On 16 April 2015 at 16:44, Emil Constantinescu wrote: > On 4/16/15 2:13 AM, Lisandro Dalcin wrote: >> >> On 16 April 2015 at 04:51, Emil Constantinescu >> wrote: >>> >>> >>> On 3/24/15 5:31 AM, Lisandro Dalcin wrote: Emil, is there any chance you can try my code with your problem?

Re: [petsc-users] TimeStepper norm problems. EMIL Please read this

2015-04-16 Thread Emil Constantinescu
On 4/16/15 2:13 AM, Lisandro Dalcin wrote: On 16 April 2015 at 04:51, Emil Constantinescu wrote: On 3/24/15 5:31 AM, Lisandro Dalcin wrote: Emil, is there any chance you can try my code with your problem? I really need some feedback to push this to PETSc, otherwise Hi Lisandro - we checke

Re: [petsc-users] TimeStepper norm problems. EMIL Please read this

2015-04-16 Thread Lisandro Dalcin
On 16 April 2015 at 04:51, Emil Constantinescu wrote: > > On 3/24/15 5:31 AM, Lisandro Dalcin wrote: >> >> Emil, is there any chance you can try my code with your problem? I >> really need some feedback to push this to PETSc, otherwise > > > Hi Lisandro - we checked ts_alpha_adapt and we tested it

Re: [petsc-users] TimeStepper norm problems. EMIL Please read this

2015-04-15 Thread Barry Smith
The more adaptors the better > On Apr 15, 2015, at 8:51 PM, Emil Constantinescu wrote: > > > On 3/24/15 5:31 AM, Lisandro Dalcin wrote: >> Emil, is there any chance you can try my code with your problem? I >> really need some feedback to push this to PETSc, otherwise > > Hi Lisandro - we c

Re: [petsc-users] TimeStepper norm problems. EMIL Please read this

2015-04-15 Thread Emil Constantinescu
On 3/24/15 5:31 AM, Lisandro Dalcin wrote: Emil, is there any chance you can try my code with your problem? I really need some feedback to push this to PETSc, otherwise Hi Lisandro - we checked ts_alpha_adapt and we tested it on a small system (mildly stiff van der Pol ODE). I enclosed a Figu

Re: [petsc-users] TimeStepper norm problems. EMIL Please read this

2015-03-31 Thread Andrew Spott
awesome, great to hear. Thanks! -Andrew On Tue, Mar 31, 2015 at 7:16 PM, Emil Constantinescu wrote: > Hi Andrew - we found a bug in TSComputeRHSFunctionLinear. > In your code you need to provide the context to TSSetRHSFunction: > TSSetRHSFunction( tss, NULL, TSComputeRHSFunctionLinear, &

Re: [petsc-users] TimeStepper norm problems. EMIL Please read this

2015-03-31 Thread Emil Constantinescu
Hi Andrew - we found a bug in TSComputeRHSFunctionLinear. In your code you need to provide the context to TSSetRHSFunction: TSSetRHSFunction( tss, NULL, TSComputeRHSFunctionLinear, &c ); For now you can check out a branch that has implemented the fix by running git checkout emil/fix-ts-dae-reba

Re: [petsc-users] TimeStepper norm problems. EMIL Please read this

2015-03-30 Thread Emil Constantinescu
On 3/30/15 9:32 PM, Andrew Spott wrote: I’m sorry, I didn’t want to imply you were taking too much time. I was just interested in trying to solve the problem myself, especially if it was a simpler fix. Nothing of that sort. I just expected to figure it out sooner, especially when you were kin

Re: [petsc-users] TimeStepper norm problems. EMIL Please read this

2015-03-30 Thread Andrew Spott
I’m sorry, I didn’t want to imply you were taking too much time.  I was just interested in trying to solve the problem myself, especially if it was a simpler fix. I don’t have enough of an understanding of the internals of PETSc though, if it depends on the compiler flags. Good luck!

Re: [petsc-users] TimeStepper norm problems. EMIL Please read this

2015-03-30 Thread Emil Constantinescu
Hi Andrew, Sorry for the delay; things are going slower with me over the spring break but we are working on it. The problem that you see may not be related to the integrator, which runs well (we get expected convergence rates and good results) for other problems, in particular, for problems

Re: [petsc-users] TimeStepper norm problems. EMIL Please read this

2015-03-30 Thread Andrew Spott
Emil:  If I want to fix this myself, do you have any idea where I should start looking?  I assume in the th->endpoint section of TSStep_Theta in http://www.mcs.anl.gov/petsc/petsc-current/src/ts/impls/implicit/theta/theta.c.html? Thanks, -Andrew On Tue, Mar 24, 2015 at 10:52 AM, Lisandro

Re: [petsc-users] TimeStepper norm problems. EMIL Please read this

2015-03-24 Thread Lisandro Dalcin
On 24 March 2015 at 18:40, Emil Constantinescu wrote: >> Of course, though my B-D is order 2, and as you said, it is the just >> for the estimator. >> >>> if the time step varies wildly (can be easily constrained), >>> it may create some problems with the estimator. >>> >> >> Indeed, the default c

Re: [petsc-users] TimeStepper norm problems. EMIL Please read this

2015-03-24 Thread Emil Constantinescu
On 3/24/15 5:31 AM, Lisandro Dalcin wrote: On 24 March 2015 at 06:15, Emil Constantinescu wrote: On 3/23/15 4:44 AM, Lisandro Dalcin wrote: Lisandro, that's a neat idea. If you are basically moving in the multistep realm for error estimation with one-step methods, I'm wondering if no one eve

Re: [petsc-users] TimeStepper norm problems. EMIL Please read this

2015-03-24 Thread Lisandro Dalcin
On 24 March 2015 at 06:15, Emil Constantinescu wrote: > On 3/23/15 4:44 AM, Lisandro Dalcin wrote: > > Lisandro, that's a neat idea. If you are basically moving in the multistep > realm for error estimation with one-step methods, I'm wondering if no one ever did it. I could not find any reference

Re: [petsc-users] TimeStepper norm problems. EMIL Please read this

2015-03-24 Thread Lisandro Dalcin
On 24 March 2015 at 01:34, Jed Brown wrote: > Lisandro Dalcin writes: > >> On 21 March 2015 at 17:32, Emil Constantinescu wrote: >>> When -ts_theta_adapt is used, then it detects the instability as an error >>> and reduces the step by a lot! wlte=1.24e+03 which means that the reduction >>> shoul

Re: [petsc-users] TimeStepper norm problems. EMIL Please read this

2015-03-23 Thread Emil Constantinescu
On 3/23/15 4:44 AM, Lisandro Dalcin wrote: I have an alternative implementation of adaptivity in PetIGA in custom Generalized-Alpha implementation. The adaptivity is not based on embed-RK like for TSCN, but in storing a solution vector from the previous step then estimate the LTE with backward di

Re: [petsc-users] TimeStepper norm problems. EMIL Please read this

2015-03-23 Thread Emil Constantinescu
On 3/23/15 5:34 PM, Jed Brown wrote: Lisandro Dalcin writes: On 21 March 2015 at 17:32, Emil Constantinescu wrote: When -ts_theta_adapt is used, then it detects the instability as an error and reduces the step by a lot! wlte=1.24e+03 which means that the reduction should be severe but the co

Re: [petsc-users] TimeStepper norm problems. EMIL Please read this

2015-03-23 Thread Jed Brown
Lisandro Dalcin writes: > On 21 March 2015 at 17:32, Emil Constantinescu wrote: >> When -ts_theta_adapt is used, then it detects the instability as an error >> and reduces the step by a lot! wlte=1.24e+03 which means that the reduction >> should be severe but the controller tries 0.1*dt and that

Re: [petsc-users] TimeStepper norm problems. EMIL Please read this

2015-03-23 Thread Lisandro Dalcin
On 21 March 2015 at 17:32, Emil Constantinescu wrote: > When -ts_theta_adapt is used, then it detects the instability as an error > and reduces the step by a lot! wlte=1.24e+03 which means that the reduction > should be severe but the controller tries 0.1*dt and that seems to pass but > it "jig-sa

Re: [petsc-users] TimeStepper norm problems. EMIL Please read this

2015-03-22 Thread Andrew Spott
Thanks! Let me know if I can do anything to help. -Andrew — Andrew On Sun, Mar 22, 2015 at 8:21 PM, Emil Constantinescu wrote: > Hi Andrew, > I can reproduce this issue and I agree that there is something wrong. > I'll look into it. > Emil > On 3/22/15 3:29 PM, Andrew Spott wrote: >> So,

Re: [petsc-users] TimeStepper norm problems. EMIL Please read this

2015-03-22 Thread Emil Constantinescu
Hi Andrew, I can reproduce this issue and I agree that there is something wrong. I'll look into it. Emil On 3/22/15 3:29 PM, Andrew Spott wrote: So, I’m now even more confused. I’m attempting to solve an equation that looks like this: u’ = -i(H0 + e(t) D) u Where H0 is a purely real diag

Re: [petsc-users] TimeStepper norm problems. EMIL Please read this

2015-03-22 Thread Andrew Spott
So, I’m now even more confused. I’m attempting to solve an equation that looks like this: u’ = -i(H0 + e(t) D) u Where H0 is a purely real diagonal matrix, D is an off-diagonal block matrix, and e(t) is a function of time (The schrödinger equation in the energy basis). I’ve rewritt

Re: [petsc-users] TimeStepper norm problems. EMIL Please read this

2015-03-21 Thread Andrew Spott
>I haven’t been able to compile and run. You might need -std=c++11 or -std=c++1y.  The code uses a lambda.  If you want, I can refactor that away.  >The problem appears to be very stiff. So, one of the things that is weird is that when I explicitly calculate the first few steps using

Re: [petsc-users] TimeStepper norm problems. EMIL Please read this

2015-03-21 Thread Barry Smith
Depending on your C++ compiler you may need to build PETSc with the additional ./configure option --with-cxx-dialect=C++11 > On Mar 21, 2015, at 9:32 AM, Emil Constantinescu wrote: > > I haven't been able to compile and run. But here are a few quick notes. > > The problem appears to be ver

Re: [petsc-users] TimeStepper norm problems. EMIL Please read this

2015-03-21 Thread Emil Constantinescu
I haven't been able to compile and run. But here are a few quick notes. The problem appears to be very stiff. Theta and theta_endpoint are defining different methods: 1) -ts_type beuler OR -ts_theta_theta 1.0: is backward Euler u(t + h) = u(t) + h*A(t+h)*u(t+h) 2) -ts_theta_theta 0.5: is the

Re: [petsc-users] TimeStepper norm problems. EMIL Please read this

2015-03-20 Thread Barry Smith
Andrew, I'm afraid Emil will have to take a look at this and explain it. The -ts_type beuler and -ts_type theta -ts_theta_theta .5 are stable but the -ts_type cn is not stable. It turns out that -ts_type cn is equivalent to -ts_type theta -ts_theta_theta .5 -ts_theta_endpoint and someh