Failure of field-solver when the beam reduces below the grid resolution.
In simulations involving the spiral inflector, OPAL can crash when a large portion of particles is lost—especially during the initial injection phase. When the number of particles becomes smaller than the number of mesh cells used in the space charge field solver, the code attempts to compute the field with insufficient data, leading to a crash or undefined behavior.
Suggested fix: Skip field computation gracefully when the particle count is too low.