|
80 | 80 | #pic solve timing |
81 | 81 | import time |
82 | 82 | N_rep_test_single = 1000 |
83 | | -print 'Solving PIC single %d times'%N_rep_test_single |
| 83 | +print('Solving PIC single %d times'%N_rep_test_single) |
84 | 84 | t_start = time.mktime(time.localtime()) |
85 | | -for _ in xrange(N_rep_test_single): |
| 85 | +for _ in range(N_rep_test_single): |
86 | 86 | pic_singlegrid.solve() |
87 | 87 | t_stop = time.mktime(time.localtime()) |
88 | 88 | t_sw_single = (t_stop-t_start)/N_rep_test_single |
89 | | -print 'solving time singlegrid ', t_sw_single |
| 89 | +print('solving time singlegrid ', t_sw_single) |
90 | 90 |
|
91 | 91 | N_rep_test_multi = 10000 |
92 | | -print 'Solving PIC multi %d times'%N_rep_test_multi |
| 92 | +print('Solving PIC multi %d times'%N_rep_test_multi) |
93 | 93 | t_start = time.mktime(time.localtime()) |
94 | | -for _ in xrange(N_rep_test_multi): |
| 94 | +for _ in range(N_rep_test_multi): |
95 | 95 | pic_multigrid.solve() |
96 | 96 | t_stop = time.mktime(time.localtime()) |
97 | 97 | t_sw_multi = (t_stop-t_start)/N_rep_test_multi |
98 | | -print 'solving time multigrid ', t_sw_multi |
| 98 | +print('solving time multigrid ', t_sw_multi) |
99 | 99 |
|
100 | 100 |
|
101 | 101 | # build probes for single circle |
|
119 | 119 | pl.subplot(1,3,1) |
120 | 120 | #~ pl.plot(pic_singlegrid.xn, pic_singlegrid.yn,'.y', label = 'Singlegrid') |
121 | 121 | #~ pl.plot(pic_singlegrid_ext.xn, pic_singlegrid_ext.yn,'.m', label = 'Singlegrid telescope') |
122 | | -for ii in xrange(pic_multigrid.n_grids): |
| 122 | +for ii in range(pic_multigrid.n_grids): |
123 | 123 | pl.plot(pic_multigrid.pic_list[ii].pic_internal.chamb.Vx, pic_multigrid.pic_list[ii].pic_internal.chamb.Vy, '.-', label = 'Internal grid %d'%ii) |
124 | 124 | pl.plot(bunch.x, bunch.y, '.k') |
125 | 125 | pl.plot(Vx, Vy, 'k--', label = 'Chamber') |
|
0 commit comments