Exemplo n.º 1
0
        pyeclsaver.Fesfx_video = []
        pyeclsaver.Fesfy_video = []
        pyeclsaver.Fbfx_video = []
        pyeclsaver.Fbfy_video = []
        pyeclsaver.Fbfz_video = []
        pyeclsaver.t_efield_video_new = []
    return 0


step_by_step_custom_observables = {
        'dummy2': lambda sim : _forces_movie_save(sim)
        }


sim = BuildupSimulation(pyecl_input_folder=sim_input_folder,
        filen_main_outp='./Pyecltest.mat',
        extract_sey=False,
        step_by_step_custom_observables = step_by_step_custom_observables)

_forces_movie_init(sim,sim_input_folder)

sim.run()

ob1 = mlo.myloadmat('Pyecltest.mat')
cloud = sim.cloud_list[0]
pyeclsaver = cloud.pyeclsaver
ob1['forces_ratio_hist'] = pyeclsaver.forces_ratio_hist
ob1['forces_ratio_hist_bins'] = pyeclsaver.forces_ratio_hist_bins
ob1['t_forces_ratio_hist'] = pyeclsaver.t_forces_ratio_hist
sio.savemat('Pyecltest_enhanced.mat', ob1, oned_as='row')
Exemplo n.º 2
0
    'ref_size':
    lambda sim: sim.cloud_list[0].MP_e.nel_mp_ref
}

pass_by_pass_custom_observables = {
    'sum_rho': lambda sim: np.sum(sim.cloud_list[0].rho, axis=1)
}

save_once_custom_observables = {
    'Vx': lambda sim: sim.cloud_list[0].impact_man.chamb.Vx
}

sim = BuildupSimulation(
    pyecl_input_folder=sim_input_folder,
    filen_main_outp='./Pyecltest.mat',
    extract_sey=False,
    step_by_step_custom_observables=step_by_step_custom_observables,
    pass_by_pass_custom_observables=pass_by_pass_custom_observables,
    save_once_custom_observables=save_once_custom_observables)

ec = sim.cloud_list[0]

for ii, t_stop in enumerate(t_stop_list):
    print('\n\n==============================')
    print(('Simulation run %d - t_stop = %s s' % (ii, repr(t_stop))))
    print((' starting at tt=%s s' % repr(sim.beamtim.tt_curr)))

    sim.run(t_end_sim=t_stop)

    print((' after run a tt=%s' % repr(sim.beamtim.tt_curr)))
Exemplo n.º 3
0
import numpy as np

from PyECLOUD.buildup_simulation import BuildupSimulation

sim_input_folder = '../../testing/tests_buildup/LHC_ArcDipReal_450GeV_sey1.70_2.5e11ppb_bl_1.00ns'

save_only = 't Nel_timep xg_hist nel_hist'.split()

sim = BuildupSimulation(
    pyecl_input_folder=sim_input_folder,
    filen_main_outp='./Pyecltest.mat',
    flag_En_hist_seg=True,
    extract_sey=False,
    Nbin_En_hist=300,
    En_hist_max=2500.,  #eV i
    save_only=save_only)

sim.run(t_end_sim=None)
Exemplo n.º 4
0
myid = comm.Get_rank()

x_aper = 2.3e-2
x_max_list = [-1e-2, 0, 1e-2, x_aper]

sim = BuildupSimulation(
    pyecl_input_folder=sim_input_folder,
    filen_main_outp='./Pyecltest_%02d.mat' % myid,
    flag_En_hist_seg=True,
    extract_sey=False,
    Nbin_En_hist=300,
    En_hist_max=2500.,  #eoV
    x_max_init_unif=x_max_list[myid])
sim.spacech_ele.comm = comm

sim.run(t_end_sim=5 * 25e-9)

ec = sim.cloud_list[0]

import matplotlib.pyplot as plt
plt.close('all')
fig = plt.figure(100 + myid)
ax1 = fig.add_subplot(2, 1, 1)
ax2 = fig.add_subplot(2, 1, 2)

ax1.plot(ec.pyeclsaver.xg_hist, np.sum(ec.pyeclsaver.nel_hist, axis=0))
ax2.plot(sim.spacech_ele.xg, np.sum(sim.spacech_ele.rho, axis=1))

plt.show()
Exemplo n.º 5
0
import sys, os
BIN = os.path.expanduser("../../../")
sys.path.append(BIN)

# sim_folder = 'LHC_ArcDipReal_450GeV_sey1.70_2.5e11ppb_bl_1.00ns'
# sim_folder = 'LHC_ArcQuadReal_450GeV_sey1.65_2.5e11ppb_bl_1.00ns'
sim_folder = 'LHC_ArcDipReal_450GeV_sey1.00_2.5e11ppb_bl_1.00ns_gas_ionization'


from PyECLOUD.buildup_simulation import BuildupSimulation


sim = BuildupSimulation(pyecl_input_folder = sim_folder, filen_main_outp = sim_folder+'/Pyecltest.mat')
sim.run()


print ''
print 'Test simulation done!'
print 'To instpect the results you can run:'
print '001_comparison_against_reference.py'
print ''
Exemplo n.º 6
0
import numpy as np

from PyECLOUD.buildup_simulation import BuildupSimulation

sim_input_folder = '../../testing/tests_buildup/LHC_ArcDipReal_450GeV_sey1.70_2.5e11ppb_bl_1.00ns'

save_once_custom_observables = {
    'Vx': lambda sim: sim.cloud_list[0].impact_man.chamb.Vx,
    'Vy': lambda sim: sim.cloud_list[0].impact_man.chamb.Vy,
    'L_edg': lambda sim: sim.cloud_list[0].impact_man.chamb.L_edg,
}

sim = BuildupSimulation(
    pyecl_input_folder=sim_input_folder,
    filen_main_outp='./Pyecltest.mat',
    filename_chm='chamber.mat',
    flag_En_hist_seg=True,
    extract_sey=False,
    Nbin_En_hist=300,
    En_hist_max=6000.,  #eV 
    save_once_custom_observables=save_once_custom_observables)

sim.run(t_end_sim=300e-9)