[petsc-dev] Fwd: [petsc-maint #70675] update of the timestep in theta method

Jeremy Riousset riousset at gatech.edu
Mon Apr 18 17:33:29 CDT 2011


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 at gatech.edu 
> <mailto:riousset at 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.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20110418/ef57ca95/attachment.html>


More information about the petsc-dev mailing list