Fixed a bug in the interpolateToGrid() method. The charge density is now calculated correctly.
A few small optimizations.
- Periodic boundary conditions for particle positions are now realised without if-else.
- rho[] and phi[] are now arrays of size 2*gridN, where the even indices are the real parts and the odd ones are the imaginary parts. This is the form that jtransforms.fft uses.
A few small optimizations in Simulation.java.
- Periodic boundary conditions for particle positions are now realised without if-else.
- rho[] and phi[] are now arrays of size 2*gridN, where the even indices are the real parts and the odd ones are the imaginary parts. This is the form that jtransforms.fft uses.
- added the initial half-step that is needed for the leapfrog algorithm.