increasing timesteps

From: Yves Revaz <yves.revaz_at_epfl.ch>
Date: Thu, 11 Oct 2012 15:08:19 +0200

Dear List,

I wanted to share a tiny trick allowing to win some computational time,
when a particle, for any reason, has decreased its timestep, and want to
quickly increase it again.

In timestep.c, we find the instruction:

if(((TIMEBASE - P[i].Ti_endstep) % ti_step) > 0)
   ti_step = P[i].Ti_endstep - P[i].Ti_begstep; /* leave at old step */

Here, the particle has to wait until it falls on a step corresponding
to the level it want to access.

This may be replaced by:

while(((TIMEBASE - P[i].Ti_endstep) % ti_step) > 0)
   ti_step = ti_step/2;

At least here, the particle will be able to jump, to an intermediate level,
if the latter exists.


Cheers,

yves





-- 
                                                 (o o)
--------------------------------------------oOO--(_)--OOo-------
   Dr. Yves Revaz
   Laboratory of Astrophysics
   Ecole Polytechnique Fédérale de Lausanne (EPFL)
   Observatoire de Sauverny     Tel : ++ 41 22 379 24 28
   51. Ch. des Maillettes       Fax : ++ 41 22 379 22 05
   1290 Sauverny             e-mail : Yves.Revaz_at_epfl.ch
   SWITZERLAND                  Web : http://www.lunix.ch/revaz/
----------------------------------------------------------------
Received on 2012-10-11 15:08:20

This archive was generated by hypermail 2.3.0 : 2022-09-01 14:03:42 CEST