Re: [petsc-users] [TimeStepping] Eventhandler

2019-02-03 Thread Huck, Moritz via petsc-users
Hi, yes there is one. My system has a set of very different time contants. At some events the fast one may be fully developped and only the slower ones are of concern after the event (depending on the postevent). If the last step is not an option, setting it manually might be helpfull since I

Re: [petsc-users] Ksp Initial residual norm

2019-02-03 Thread Smith, Barry F. via petsc-users
Oh yes. Better than my suggestion since it requires no coding.\ Barry > On Feb 3, 2019, at 3:40 PM, Matthew Knepley wrote: > > On Sun, Feb 3, 2019 at 2:24 PM Smith, Barry F. via petsc-users > wrote: > > > > On Feb 3, 2019, at 1:16 PM, Edoardo alinovi > > wrote: > > > > Thank you

Re: [petsc-users] Ksp Initial residual norm

2019-02-03 Thread Matthew Knepley via petsc-users
On Sun, Feb 3, 2019 at 2:24 PM Smith, Barry F. via petsc-users < petsc-users@mcs.anl.gov> wrote: > > > > On Feb 3, 2019, at 1:16 PM, Edoardo alinovi > wrote: > > > > Thank you very much Barry for the suggestion. > > > > Unfortunately, I am using Fortran and not C++ . Do you have an > equivalent

Re: [petsc-users] Ksp Initial residual norm

2019-02-03 Thread Smith, Barry F. via petsc-users
> On Feb 3, 2019, at 1:16 PM, Edoardo alinovi wrote: > > Thank you very much Barry for the suggestion. > > Unfortunately, I am using Fortran and not C++ . Do you have an equivalent > trick in this case? :) You would need to provide this function as a C function (in its own little .c

Re: [petsc-users] Ksp Initial residual norm

2019-02-03 Thread Smith, Barry F. via petsc-users
If you use the default KSP convergence tests (which almost everyone does) the initial residual norm is stored in ksp->rnorm0. Thus to access it you need to include the private header file that defines the KSP object kspimpl.h so something like #include PetscErrorCode

Re: [petsc-users] [TimeStepping] Eventhandler

2019-02-03 Thread Moritz Huck via petsc-users
Hi, I see I am sorry, I misinterpreted the output -ts_adapt_monitor. You are right point 2 is not an issue. I there a way to let the time stepping continue with the last time step instead of the initial time step? Best Regards, Moritz Am 03.02.19 um 17:04 schrieb Zhang, Hong: ex40 seems

Re: [petsc-users] [TimeStepping] Eventhandler

2019-02-03 Thread Zhang, Hong via petsc-users
ex40 seems to work fine. Here is the output with -ts_monitor -ts_event_monitor -ts_dt 0.01 : 8 TS dt 0.5 time 3.11 9 TS dt 0.5 time 3.61 TSEvent: iter 0 - Event 0 interval detected [3.61 - 4.11] 9 TS dt 0.467955 time 3.61 (r) TSEvent: iter 1 - Stepping forward as no event detected in interval

Re: [petsc-users] [TimeStepping] Eventhandler

2019-02-03 Thread Moritz Huck via petsc-users
Hi Barry, src/ts/examples/tutorials/ex40.c (run with ARKIMEX3 and initial dt=1e-2) has the same behavior: TSEvent: iter 0 - Event 0 interval detected [3.61 - 4.11] TSEvent: iter 1 - Stepping forward as no event detected in interval [3.61 - 4.07796] TSEvent: iter 2 - Stepping forward as no

Re: [petsc-users] [TimeStepping] Eventhandler

2019-02-03 Thread Moritz Huck via petsc-users
Hi Hong, I am using adaptive timestepping (ARKIMEX, fully implicit). Best Regards, Moritz Am 03.02.19 um 01:59 schrieb Zhang, Hong: Hi Moritz, Are you using adaptive time stepping or fixed time stepping? When a fixed stepsize is used, the next time step after an event will be set to the