[petsc-users] Question about changing time step during calculation

Smith, Barry F. bsmith at mcs.anl.gov
Sun Nov 17 23:24:51 CST 2019



> On Nov 17, 2019, at 5:32 PM, Zhang, Hong via petsc-users <petsc-users at mcs.anl.gov> wrote:
> 
> TSSetTimeStep()
> 
> https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/TS/TSSetTimeStep.html#TSSetTimeStep
> 
> If you want to decide the step size by yourself, make sure that the adaptivity is turned off, e.g., with -ts_adapt_type none
> 
> Btw, have you tried the available TSAdapt types? Is there anything special in your problems so that none of these adaptors works?

  It is also possible to register your own adaptor using TSAdaptRegister(). You can start writing you own by copying the basic adapter src/ts/adapt/impls/basic/adaptbasic.c; you can also look at the other adaptors for ideas. Note this is an advanced topic that only needs to be used when none of standard adapters are useful for your situation.

  Barry

> 
> Hong (Mr.)
> 
>> On Nov 17, 2019, at 9:25 AM, Yingjie Wu via petsc-users <petsc-users at mcs.anl.gov> wrote:
>> 
>> Dear Petsc developers
>> Hi,
>> Recently I am trying to using TS to solve time-dependent nonlinear PDEs. In my program, next time step is based on the results of previous time step. I want to add this control in TSmonitor() to change time step length in calculation. I referred to user guide but I didn't find what I wanted. Please give me some advice.
>> 
>> Thanks,
>> Yingjie
> 



More information about the petsc-users mailing list