double xChange = timeStep * vel.x;
double yChange = timeStep * vel.y;
particle.set( particle.x + xChange, particle.y + yChange );
particle.incAge( timeStep );
Cell newHomeCell = findNewHomeCell(particle, i, j);
assert ( particle.x >= 1 && particle.y >= 1
&& particle.x < grid.getXDimension() - 1
&& particle.y < grid.getYDimension() - 1) :
"particle.x=" + particle.x + "particle.y=" + particle.y ;
// adjust # particles as they cross cell boundaries
newHomeCell.incParticles(); // increment new cell
grid.getCell(i, j).decParticles(); // decrement last cell
particle.setCell( newHomeCell );
assert ( grid.getCell(i, j).getNumParticles() >= 0):
"The number of particles in grid[" + i + "][" + j + "] is " + grid.getCell(i, j).getNumParticles();
assert ( newHomeCell.getNumParticles() >= 0 );
return vel.length();
}