Fixed GUI s.t. it doesnt enable collision detection during initialization

Removed previous workaround that prevented that behaviour.
Combined the enabling and disabling of collisions with the selection of the collision detection method.
Merge pull request #48 from kstrel/uifix-collisions2

Fixed GUI s.t. it doesnt enable collision detection during initialization

Previously we had a boolean variable in the Simulation class that enabled and disabled collision detection (even though we actually have empty detector classes for that). That also meant that setting a non-empy detector algorithm in the Settings class (for the non-gui version for example) wouldnt actually enable collisions. The boolean in the Simulation class would have had to be changed too.

The boolean was a workaround because without it the GUI always enabled collision detection during initialization. I have fixed it now. The problem was that detectorChange() and algorithmCollisionChange() from Particle2DPanel were called during initialization and these two methods could only set non-empty detector classes.

Furthermore I have combined the enabling and disabling of collisions with the selection of the collision detection method into one dropdown menu.
Changed the interpolateToParticle() method.

The algorithm now takes into account that the Bz, Ex and Ey fields are located at different places in the cell even if they have the same index.
The new CIC interpolator needs two extra cells at the beginning.

TODO: Check comments
Moved checkPeriodicBoundary method to the only algorithm where it is used.
Moved chargedensity interpolation method to the CIC algorithm because it is specific to this algorithm.
Changed InterpolatorAlgorithm to an interface.
Added purely esthetic comment
Changed the interpolateChargeDensity() method. It now takes into account that the charge density is defined in the middle of a cell.

Slight tweaks to the interpolateToParticle() method.
Furthermore a few comments were changed.
Bz is averaged and given at integer time to the particle.

A dependence on the old Bz is introduced.
Removed unneccessary check.

a is always positive because if p.getX() is negative then i is also negative and a becomes positive again.
Removed +0.5*cellWidth(cellHeight) corrections for the case where the particles are behind the left or the lower boundary. These corrections are implicit in these cases because the particle positions are measured from the right(upper) part of the cell.
Corrected and verified charge and to particle interpolation. (made a sketch of the algorithm)
Current interpolation now takes into account that the current fields are located on shifted grids. The new implementation is the same as in the charge and "to particle" interpolation methods.
Enables the interpolateChargeDensity() test. The test works now.
Fixed bugs (the algorithm remains, it was not implelemted correctly). Unit tests now pass.
Added testMoveSimple(). It is a simplified version of testMove() that has only very few dependencies.
Corrected the LeapFrog algorithm.

* E and B field calculations are now in the right order.
* First all the new E components are calculated only then the B calculation starts. This is the correct LeapFrog scheme.
* The dependence on the old fields was removed.
Merge pull request #51 from kstrel/fieldsolver-corrections

Corrected the SimpleSolver algorithm.

E and B field calculations are now in the right order.
First all the new E components are calculated only then the B calculation starts. This is the correct LeapFrog scheme.
The dependence on the old fields was removed.
This dramatically improves the stability of the whole simulation.
Merge pull request #50 from kstrel/interpolator

CIC Interpolator Rewrite

* InterpolatorAlgorithm is now an interface.
* The charge conserving current interpolator now extends the CIC interpolator because its just a refined version of it.
* The CIC interpolator was completely rewritten. It now takes into account that we are using a FDTD grid where the different fields are displaced.
* The interpolator now gives a Bz to the particle that is averaged over time. This is needed because the particle expects a Bz at integer time (just as Ex and Ey) but the field solver gives a Bz at t+dt/2. A dependency on the old Bz had to be introduced.