swiftest.Simulation.set_simulation_time#
- Simulation.set_simulation_time(t0=None, tstart=None, tstop=None, dt=None, istep_out=None, tstep_out=None, nstep_out=None, dump_cadence=None, **kwargs)[source]#
Set the parameters that control how a simulation is run, such as start and stop time, step size, and the cadence of output to both the screen and to file. Returns a dictionary of the parameters that were set.
- Parameters:
t0 (float, optional) – The reference time for the start of the simulation. Defaults is 0.0
tstart (float, optional) – The start time for a restarted simulation. For a new simulation, tstart will be set to t0 automatically.
tstop (float, optional) – The stopping time for a simulation. tstop must be greater than tstart.
dt (float, optional) – The step size of the simulation. dt must be less than or equal to tstop-dstart.
istep_out (int, optional) – The number of time steps between output saves to file. Only istep_out or tstep_out can be set. Parameter input file equivalent is ISTEP_OUT
tstep_out (float, optional) –
The approximate time between when outputs are written to file. Passing this computes:
`istep_out = floor(tstep_out/dt)`.
Only istep_out or tstep_out can be set. Parameter input file equivalent is None
nstep_out (int, optional) –
The total number of times that outputs are written to file. Passing this allows for a geometric progression of output steps:
TSTART, f**0 * TSTEP_OUT, f**1 * TSTEP_OUT, f**2 * TSTEP_OUT, …, f**(nstep_out-1) * TSTEP_OUT
where f is a factor that can stretch (or shrink) the time between outputs. Setting:
nstep_out = int((tstart - tstop) / (tstep_out))
is equivalent to the standard linear output (i.e. f==1) and is the same as not passing anything for this argument. Passing nstep_out requires passing either istep_out or tstep_out as well.
dump_cadence (int, optional) – The number of output steps (given by istep_out) between when the saved data is dumped to a file. Setting it to 0 is equivalent to only dumping data to file at the end of the simulation. Default value is 10. Parameter input file equivalent is DUMP_CADENCE
**kwargs – A dictionary of additional keyword argument. This allows this method to be called by the more general set_parameter method, which takes all possible Simulation parameters as arguments, so these are ignored.
- Returns:
time_dict (dict) – A dictionary containing the requested parameters