The WaveBlocks Project
@author: R. Bourquin @copyright: Copyright (C) 2010, 2011, 2012 R. Bourquin @license: Modified BSD License
This class performs several computation with time, timesteps and so for.
The important quantities here are: T : the fixed simulation end time dt : the size of the timestep N : the overall number of timesteps. t : an unspecified time in the interval [0, T] n : an unspecified timestep in the interval [0, N] The importtant relations that hold are: T = N * dt and in analogy t = n * dt
There are also conversion routines for t and n. Additionally the class contains some routines for determining if and when to save data. But we do not touch any data in here.
Add a list of times and/or timesteps to the list of times which determine when to save data.
Parameters: | alist – A list with integers (interpreted as timesteps) and/or floats (interpreted as times) |
---|
Note
The times and timesteps can be mixed and needn’t to be given in monotone order.
Compute the number of saves we will perform during the simulation. This can be used to determine how much space to allocate in the output files.
Computes the number of time steps we will perform.
Compute the time t from a timestep n such that t = n * dt holds.
Parameters: | n – The timestep n of which we want to find the corresponding time. |
---|
Compute the timestep n from a time t such that t = n * dt holds.
Parameters: | t – The time t of which we want to find the timestep number. |
---|
Note
The user has to ensure that time is an integral multiple of dt.
Determine if we have to save right now.
Parameters: | n – The current timestep in question. |
---|
Set the simulation endtime T.
Parameters: | T – The simulation end time. |
---|
Set the simulation timestep size dt.
Parameters: | dt – The simulation timestep size. |
---|
Set the inteval for saving results.
Parameters: | interval – The interval at which we save simulation results. |
---|
Note
A value of 0 means we never save data at any regular interval.
Set the number of timesteps the simulation runs.
Parameters: | nsteps – The number timesteps we do. |
---|