Skip to content
Snippets Groups Projects
Commit 13f4fff2 authored by Vadim Gubaidulin's avatar Vadim Gubaidulin
Browse files

bugfixes

parent faf41fb0
No related branches found
No related tags found
2 merge requests!280.8.0,!18Ions
...@@ -464,13 +464,13 @@ class BeamIonElement(Element): ...@@ -464,13 +464,13 @@ class BeamIonElement(Element):
@wraps(track) @wraps(track)
def track_wrapper(*args, **kwargs): def track_wrapper(*args, **kwargs):
if isinstance(args[1], Beam): if isinstance(args[1], Beam):
if Beam.switch_mpi: self = args[0]
beam = args[1]
if beam.mpi_switch:
warnings.warn( warnings.warn(
'Tracking through beam-ion element is performed sequentially. Bunches are not parallelized.', 'Tracking through beam-ion element is performed sequentially. Bunches are not parallelized.',
UserWarning, UserWarning,
stacklevel=2) stacklevel=2)
self = args[0]
beam = args[1]
for bunch in beam.bunch_list: for bunch in beam.bunch_list:
track(self, bunch, *args[2:], **kwargs) track(self, bunch, *args[2:], **kwargs)
else: else:
...@@ -608,9 +608,9 @@ class BeamIonElement(Element): ...@@ -608,9 +608,9 @@ class BeamIonElement(Element):
The new y momentum of the first beam. The new y momentum of the first beam.
""" """
en_x, en_y = BeamIonElement._get_efields(first_beam, en_x, en_y = self._get_efields(first_beam,
second_beam, second_beam,
field_model=field_model) field_model=field_model)
kicks_x = prefactor * en_x kicks_x = prefactor * en_x
kicks_y = prefactor * en_y kicks_y = prefactor * en_y
new_xp = first_beam["xp"] + kicks_x new_xp = first_beam["xp"] + kicks_x
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment