Skip to content

Commit 8b6d311

Browse files
committed
No visible impact on performance from the presence of disabled radiation
1 parent b4ef41c commit 8b6d311

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

examples/full_ring/006_timing.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@
4040
# Choose a context #
4141
####################
4242

43-
n_part = 8000
44-
context = xo.ContextCpu(omp_num_threads=8)
45-
#context = xo.ContextCpu(omp_num_threads=0)
43+
#n_part = 8000
44+
#context = xo.ContextCpu(omp_num_threads=8)
45+
46+
n_part = 200
47+
context = xo.ContextCpu(omp_num_threads=0)
4648

4749
#n_part = 20000
4850
#context = xo.ContextCupy()

xtrack/beam_elements/elements_src/multipole.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ void Multipole_track_local_particle(MultipoleData el, LocalParticle* part0){
3838

3939
// compute the average energy loss by synchrotron radiation
4040
double const length = MultipoleData_get_length(el); // m
41-
//if (radiation_flag>0 && length!=0.0) {
42-
if (length!=0.0) {
41+
if (radiation_flag>0 && length!=0.0) {
4342
double const h = hypot(dpx, dpy) / length; // 1/m, 1/rho, curvature
4443
double const p0c = LocalParticle_get_p0c(part); // eV
4544
double const m0 = LocalParticle_get_mass0(part); // eV/c^2
@@ -53,9 +52,9 @@ void Multipole_track_local_particle(MultipoleData el, LocalParticle* part0){
5352
double const eloss = 2.0 / 3.0 * classical_radius*length * beta_gamma*beta_gamma*beta_gamma * h*h * energy; // eV
5453

5554
// apply the energy kick
56-
//LocalParticle_add_to_energy(part, -eloss);
57-
LocalParticle_add_to_energy(part, 0.);
55+
LocalParticle_add_to_energy(part, -eloss);
5856

57+
// A random number can be generated in this way
5958
double r = LocalParticle_generate_random_double(part);
6059

6160
}

0 commit comments

Comments
 (0)