Skip to content
Snippets Groups Projects
Commit c1a3690d authored by Gamelin Alexis's avatar Gamelin Alexis
Browse files

Optimise beam phasor init in non parallel case

parent 7ab381fa
No related branches found
No related tags found
No related merge requests found
......@@ -299,8 +299,18 @@ class CavityResonator():
bin_length = center[1]-center[0]
charge_per_mp = beam.mpi.charge_per_mp_all[j]
else:
# get bunch profile for current bunch
(bins, sorted_index, profile, center) = bunch.binning()
if i == 0:
# get bunch profile for current bunch
(bins, sorted_index, profile, center) = bunch.binning()
if j == 0:
self.profile_save = np.zeros((len(beam),len(profile),))
self.center_save = np.zeros((len(beam),len(center),))
self.profile_save[j,:] = profile
self.center_save[j,:] = center
else:
profile = self.profile_save[j,:]
center = self.center_save[j,:]
bin_length = center[1]-center[0]
charge_per_mp = bunch.charge_per_mp
......
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