As more and more feature get added, we should think about a suitable file format for loading and saving simulation states. A new student will work on this, but it is good if we define the file format first. I'm thinking of a variation of the Windows INI file format (
) because of its simplicity. (Maybe Jan would like to convince us that XML would be better, but I think that would be overkill for our purposes. Scientists only know how to edit simple text files :-) )
Here is a suggested file format.
# OpenPixi file format.
# Comments start with '#' and are allowed anywhere.
version=0.4 # version number is always good to know
bx=1 # add some background magnetic field.
# other values are 0 by default.
[Particle] # add a particle
p=20,25 # position
v=0,0 # initial velocity
[Particle] # create a second particle
v=-5,0 # let it collide with first particle
# if parameters like mass or charge are omitted,
# then parameters from previous particle are used.
Instead of specifying each particle separately, one could also create many random particles at once:
n=1000 # number of particles
vmax = 2 # maximum velocity, randomly distributed
n=500 # create 500 more particles
charge=-1 # with opposite charge.
Additionally, simulation data could be written to a file:
data=time, p.1.x, p.1.y # three columns: time, particle1.x, particle2.x
# Let's write at the same time the data for particle 2 into another file
data=time, p.2.x, p.2.y
What do you think?