ConstantForce force = new ConstantForce();
force.ex = ex;
force.bz = bz;
stt.addForce(force);
Simulation s = new Simulation(stt);
s.prepareAllParticles();
// Advance particle
s.particlePush();
// The simulation always creates its own copy of particles
// (in fact the setting class does so)
// and we would like to obtain the reference to our initial particle p.
p = s.particles.get(0);
//Remember old values after boundary check
double sx = p.getPrevX();
double sy = p.getPrevY();
// Calculate current
s.getInterpolation().interpolateToGrid(s.particles, s.grid, s.tstep);
double jx = GridTestCommon.getJxSum(s.grid);
double jy = GridTestCommon.getJySum(s.grid);
if (VERBOSE) System.out.println("Total current " + text + ": jx = " + jx + ", jy = " + jy