SixTrack / sixtracklib

Library for single charged particle simulations in accelerators
GNU Lesser General Public License v2.1
12 stars 16 forks source link

Beam beam special case to be handled #114

Open giadarol opened 4 years ago

giadarol commented 4 years ago

Found in pysixtrack tests that beam beam has a division by zero if:

Fixed in pysixtrack, implement also in Sixtracklib

martinschwinzerl commented 4 years ago

@giadarol : would it be acceptable to use

(x*x + y*y) < ( min_sigma_diff * min_sigma_diff)

instead of

(fabs(x) + fabs(y)) < min_sigma_diff

This would be easier to vectorize and we can reuse the x*x + y*y term multiple times in the same function. Plus, if I understand correctly, this is condition gauges the "real" (euclidian) distance from the reference particle rather than the maximum norm

giadarol commented 4 years ago

That’s perfectly fine