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 (
http://en.wikipedia.org/wiki/INI_file ) 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.
[Simulation]
version=0.4 # version number is always good to know
width=100
height=100
timestep=0.01
solver=BorisRelativistic
grid=YeeGrid
boundary=PeriodicBoundary
[ConstantForceRelativistic]
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
radius=1
mass=0.1
charge=+1
[Particle] # create a second particle
p=70,25
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:
--------------------
[RandomParticles]
n=1000 # number of particles
vmax = 2 # maximum velocity, randomly distributed
radius=0.23
mass=0.1
charge=+1
[RandomParticles]
n=500 # create 500 more particles
charge=-1 # with opposite charge.
--------------------
Additionally, simulation data could be written to a file:
----------------
[Output]
filename=C:\mydata\two-particle-collision1.dat
data=time, p.1.x, p.1.y # three columns: time, particle1.x, particle2.x
[Output]
# Let's write at the same time the data for particle 2 into another file
filename=C:\mydata\two-particle-collision2.dat
data=time, p.2.x, p.2.y
-------------
What do you think?