Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
giadarol committed Apr 5, 2016
2 parents a29cfe4 + d917ffe commit e686032
Show file tree
Hide file tree
Showing 32 changed files with 167 additions and 37 deletions.
2 changes: 1 addition & 1 deletion MP_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# This file is part of the code:
#
# PyECLOUD Version 5.0.2
# PyECLOUD Version 5.1.0
#
#
# Author and contact: Giovanni IADAROLA
Expand Down
22 changes: 17 additions & 5 deletions PyEC4PyHT.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#
# This file is part of the code:
#
# PyECLOUD Version 5.0.2
# PyECLOUD Version 5.1.0
#
#
# Author and contact: Giovanni IADAROLA
Expand Down Expand Up @@ -83,16 +83,19 @@ class MP_light(object):

class Ecloud(object):
def __init__(self, L_ecloud, slicer, Dt_ref, pyecl_input_folder='./', flag_clean_slices = False,
slice_by_slice_mode=False, **kwargs):
slice_by_slice_mode=False, space_charge_obj=None, **kwargs):


print 'PyECLOUD Version 5.0.2'
print 'PyECLOUD Version 5.1.0'
print 'PyHEADTAIL module'
print 'Initializing ecloud from folder: '+pyecl_input_folder
self.slicer = slicer
self.Dt_ref = Dt_ref
self.L_ecloud = L_ecloud

self.pyecl_input_folder = pyecl_input_folder
self.kwargs = kwargs

b_par, x_aper, y_aper, B,\
gas_ion_flag, P_nTorr, sigma_ion_MBarn, Temp_K, unif_frac, E_init_ion,\
Emax, del_max, R0, E_th, sigmafit, mufit,\
Expand Down Expand Up @@ -158,7 +161,10 @@ def __init__(self, L_ecloud, slicer, Dt_ref, pyecl_input_folder='./', flag_clean
print '''sparse_solver: 'klu' no longer supported --> going to PyKLU'''
sparse_solver='PyKLU'

spacech_ele = scc.space_charge(chamb, Dh_sc, Dt_sc=Dt_sc, sparse_solver=sparse_solver, PyPICmode=PyPICmode)
if space_charge_obj is not None:
spacech_ele = space_charge_obj
else:
spacech_ele = scc.space_charge(chamb, Dh_sc, Dt_sc=Dt_sc, sparse_solver=sparse_solver, PyPICmode=PyPICmode)


if switch_model==0 or switch_model=='ECLOUD':
Expand Down Expand Up @@ -191,7 +197,7 @@ def __init__(self, L_ecloud, slicer, Dt_ref, pyecl_input_folder='./', flag_clean
import dynamics_Boris_multipole as dynmul
dynamics=dynmul.pusher_Boris_multipole(Dt=Dt, N_sub_steps=N_sub_steps, B_multip = B_multip)
else:
raise ValueError("""track_method should be 'Boris' or 'BorisMultipole' - others are not implemented in the PyHEADTAIL module""")
raise ValueError("""track_method should be 'Boris' or 'BorisMultipole' - others are not implemented in the PyEC4PyHT module""")


if init_unif_flag==1:
Expand Down Expand Up @@ -497,6 +503,12 @@ def _track_in_single_slice_mode(self, beam):
if beam.slice_info is not 'unsliced':
dz = beam.slice_info['z_bin_right']-beam.slice_info['z_bin_left']
self._track_single_slice(beam, ix=np.arange(beam.macroparticlenumber), dz=dz)

def generate_twin_ecloud_with_shared_space_charge(self):
if hasattr(self, 'efieldmap'):
raise ValueError('Ecloud has been replaced with field map. I cannot generate a twin ecloud!')
return Ecloud(self.L_ecloud, self.slicer, self.Dt_ref, self.pyecl_input_folder, self.flag_clean_slices,
self.slice_by_slice_mode, space_charge_obj=self.spacech_ele, **self.kwargs)



Expand Down
2 changes: 1 addition & 1 deletion beam_and_timing.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# This file is part of the code:
#
# PyECLOUD Version 5.0.2
# PyECLOUD Version 5.1.0
#
#
# Author and contact: Giovanni IADAROLA
Expand Down
4 changes: 2 additions & 2 deletions buildup_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#
# This file is part of the code:
#
# PyECLOUD Version 5.0.2
# PyECLOUD Version 5.1.0
#
#
# Author and contact: Giovanni IADAROLA
Expand Down Expand Up @@ -59,7 +59,7 @@
class BuildupSimulation(object):
def __init__(self, pyecl_input_folder='./', **kwargs):

print 'PyECLOUD Version 5.0.2'
print 'PyECLOUD Version 5.1.0'
beamtim,MP_e, dynamics,impact_man, pyeclsaver, \
gas_ion_flag, resgasion, t_ion, \
spacech_ele,t_sc_ON, photoem_flag, phemiss,\
Expand Down
2 changes: 1 addition & 1 deletion change_version_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
with open(filename) as fid:
content=fid.read()
if '[email protected]' in content:
content=content.replace('PyECLOUD Version 5.0.2', 'PyECLOUD Version 5.0.2')
content=content.replace('PyECLOUD Version 5.1.0', 'PyECLOUD Version 5.1.0')
with open(filename,'w') as fid:
fid.write(content)

Expand Down
2 changes: 1 addition & 1 deletion dynamics_Boris_f2py.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# This file is part of the code:
#
# PyECLOUD Version 5.0.2
# PyECLOUD Version 5.1.0
#
#
# Author and contact: Giovanni IADAROLA
Expand Down
2 changes: 1 addition & 1 deletion dynamics_Boris_multipole.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# This file is part of the code:
#
# PyECLOUD Version 5.0.2
# PyECLOUD Version 5.1.0
#
#
# Author and contact: Giovanni IADAROLA
Expand Down
2 changes: 1 addition & 1 deletion dynamics_dipole.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# This file is part of the code:
#
# PyECLOUD Version 5.0.2
# PyECLOUD Version 5.1.0
#
#
# Author and contact: Giovanni IADAROLA
Expand Down
2 changes: 1 addition & 1 deletion dynamics_strong_B_generalized.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# This file is part of the code:
#
# PyECLOUD Version 5.0.2
# PyECLOUD Version 5.1.0
#
#
# Author and contact: Giovanni IADAROLA
Expand Down
2 changes: 1 addition & 1 deletion gas_ionization_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# This file is part of the code:
#
# PyECLOUD Version 5.0.2
# PyECLOUD Version 5.1.0
#
#
# Author and contact: Giovanni IADAROLA
Expand Down
2 changes: 1 addition & 1 deletion gen_photoemission_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# This file is part of the code:
#
# PyECLOUD Version 5.0.2
# PyECLOUD Version 5.1.0
#
#
# Author and contact: Giovanni IADAROLA
Expand Down
2 changes: 1 addition & 1 deletion geom_impact_ellip.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# This file is part of the code:
#
# PyECLOUD Version 5.0.2
# PyECLOUD Version 5.1.0
#
#
# Author and contact: Giovanni IADAROLA
Expand Down
2 changes: 1 addition & 1 deletion geom_impact_poly.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# This file is part of the code:
#
# PyECLOUD Version 5.0.2
# PyECLOUD Version 5.1.0
#
#
# Author and contact: Giovanni IADAROLA
Expand Down
2 changes: 1 addition & 1 deletion geom_impact_poly_fast_impact.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# This file is part of the code:
#
# PyECLOUD Version 5.0.2
# PyECLOUD Version 5.1.0
#
#
# Author and contact: Giovanni IADAROLA
Expand Down
2 changes: 1 addition & 1 deletion geom_impact_rect_fast_impact.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# This file is part of the code:
#
# PyECLOUD Version 5.0.2
# PyECLOUD Version 5.1.0
#
#
# Author and contact: Giovanni IADAROLA
Expand Down
2 changes: 1 addition & 1 deletion impact_management_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# This file is part of the code:
#
# PyECLOUD Version 5.0.2
# PyECLOUD Version 5.1.0
#
#
# Author and contact: Giovanni IADAROLA
Expand Down
2 changes: 1 addition & 1 deletion init.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# This file is part of the code:
#
# PyECLOUD Version 5.0.2
# PyECLOUD Version 5.1.0
#
#
# Author and contact: Giovanni IADAROLA
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#
# This file is part of the code:
#
# PyECLOUD Version 5.0.2
# PyECLOUD Version 5.1.0
#
#
# Author and contact: Giovanni IADAROLA
Expand Down
2 changes: 1 addition & 1 deletion proc_video3.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# This file is part of the code:
#
# PyECLOUD Version 5.0.2
# PyECLOUD Version 5.1.0
#
#
# Author and contact: Giovanni IADAROLA
Expand Down
4 changes: 2 additions & 2 deletions pyecloud_saver.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#
# This file is part of the code:
#
# PyECLOUD Version 5.0.2
# PyECLOUD Version 5.1.0
#
#
# Author and contact: Giovanni IADAROLA
Expand Down Expand Up @@ -68,7 +68,7 @@ def __init__(self, logfile_path):
self.logfile_path = logfile_path
print 'Starting pyecloud_saver init.'
flog=open(self.logfile_path,'w')
flog.write('PyECLOUD Version 5.0.2\n')
flog.write('PyECLOUD Version 5.1.0\n')
timestr = time.strftime("%d %b %Y %H:%M:%S", time.localtime())
flog.write('Simulation started on %s\n'%timestr)
flog.close()
Expand Down
2 changes: 1 addition & 1 deletion sec_emission.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# This file is part of the code:
#
# PyECLOUD Version 5.0.2
# PyECLOUD Version 5.1.0
#
#
# Author and contact: Giovanni IADAROLA
Expand Down
2 changes: 1 addition & 1 deletion sec_emission_model_ECLOUD.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# This file is part of the code:
#
# PyECLOUD Version 5.0.2
# PyECLOUD Version 5.1.0
#
#
# Author and contact: Giovanni IADAROLA
Expand Down
2 changes: 1 addition & 1 deletion sec_emission_model_ECLOUD_nunif.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# This file is part of the code:
#
# PyECLOUD Version 5.0.2
# PyECLOUD Version 5.1.0
#
#
# Author and contact: Giovanni IADAROLA
Expand Down
2 changes: 1 addition & 1 deletion sec_emission_model_accurate_low_ene.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# This file is part of the code:
#
# PyECLOUD Version 5.0.2
# PyECLOUD Version 5.1.0
#
#
# Author and contact: Giovanni IADAROLA
Expand Down
2 changes: 1 addition & 1 deletion sec_emission_model_cos_low_ener.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# This file is part of the code:
#
# PyECLOUD Version 5.0.2
# PyECLOUD Version 5.1.0
#
#
# Author and contact: Giovanni IADAROLA
Expand Down
2 changes: 1 addition & 1 deletion sec_emission_model_flat_low_ener.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# This file is part of the code:
#
# PyECLOUD Version 5.0.2
# PyECLOUD Version 5.1.0
#
#
# Author and contact: Giovanni IADAROLA
Expand Down
2 changes: 1 addition & 1 deletion sincc_cosincc_cubsincc.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# This file is part of the code:
#
# PyECLOUD Version 5.0.2
# PyECLOUD Version 5.1.0
#
#
# Author and contact: Giovanni IADAROLA
Expand Down
2 changes: 1 addition & 1 deletion space_charge_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# This file is part of the code:
#
#
# PyECLOUD Version 5.0.2
# PyECLOUD Version 5.1.0
#
#
# Author and contact: Giovanni IADAROLA
Expand Down
2 changes: 1 addition & 1 deletion space_charge_class_SW_old.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# This file is part of the code:
#
#
# PyECLOUD Version 5.0.2
# PyECLOUD Version 5.1.0
#
#
# Author and contact: Giovanni IADAROLA
Expand Down
2 changes: 1 addition & 1 deletion test_StrongB_generalized.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# This file is part of the code:
#
# PyECLOUD Version 5.0.2
# PyECLOUD Version 5.1.0
#
#
# Author and contact: Giovanni IADAROLA
Expand Down
2 changes: 1 addition & 1 deletion test_StrongB_generalized_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# This file is part of the code:
#
# PyECLOUD Version 5.0.2
# PyECLOUD Version 5.1.0
#
#
# Author and contact: Giovanni IADAROLA
Expand Down
Loading

0 comments on commit e686032

Please sign in to comment.