Hi,

It seems that when I want to modify the time step before the call of TSSetInitialTimeStep, I run into an error. I compare a value read from an input file to a hard coded value and the code systematically use the value from the file. Any idea why?

in order, I call
ierr = PetscOptionsGetReal(PETSC_NULL,"-ts_dt",&user.dt,PETSC_NULL);CHKERRQ(ierr);
then define
user.dt = something smaller than what is put in the file
then print
user.dt (which returns the modified value)
then call
ierr = TSSetInitialTimeStep(ts,user.ti,user.dt);CHKERRQ(ierr);

but the value read by PetscOptionsGetReal is used by TSSetInitialTimeStep

Thanks for your help,

--Jeremy

On 04/18/2011 03:19 PM, Jed Brown wrote:
On Mon, Apr 18, 2011 at 21:17, Jeremy Riousset <riousset@gatech.edu> wrote:
I was thinking to call it in the Monitor function.

You can also do that, but then the output of other monitors is dependent on whether it comes before or after your "monitor" changes the step size. Using TSSetPostStep is better in that regard because it is consistent.