Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #413: limit vacuum step size in magnetic field
Adjust the charged particle step routine for transport in vacuum when there is an electromagnetic field (emf). The existing logic failed because the emf step size restriction was not taken into account before the howfar call. Hence the howfar method tracked the particle in a single straight step across the entire vacuum region, causing erroneous region changes and discards. Also check if the particle in fact entered a new region before calling the macro to change the region, since charged particle may take many steps through a vacuum region when there is a field. Remove redundant step size restriction code in the vacuum emf transport macro, now that the field step size restriction in vacuum has been moved ahead of howfar in the electr subroutine.
- Loading branch information