44/*gpufun*/
55void Multipole_track_local_particle (MultipoleData el , LocalParticle * part0 ){
66
7+ int64_t radiation_flag = MultipoleData_get_radiation_flag (el );
8+
79 //start_per_particle_block (part0->part)
810 int64_t order = MultipoleData_get_order (el );
911 int64_t index_x = 2 * order ;
@@ -36,6 +38,7 @@ void Multipole_track_local_particle(MultipoleData el, LocalParticle* part0){
3638
3739 // compute the average energy loss by synchrotron radiation
3840 double const length = MultipoleData_get_length (el ); // m
41+ //if (radiation_flag>0 && length!=0.0) {
3942 if (length != 0.0 ) {
4043 double const h = hypot (dpx , dpy ) / length ; // 1/m, 1/rho, curvature
4144 double const p0c = LocalParticle_get_p0c (part ); // eV
@@ -47,27 +50,14 @@ void Multipole_track_local_particle(MultipoleData el, LocalParticle* part0){
4750 double const q0 = LocalParticle_get_q0 (part ); // e
4851 // e^2 / 4 pi epsilon0 eV = (1 / 694461541.7756249) m
4952 double const classical_radius = q0 * q0 / m0 / 694461541.7756249 ; // m, classical electromagnetic radius
50- double const eloss = 0 * 2.0 / 3.0 * classical_radius * length * beta_gamma * beta_gamma * beta_gamma * h * h * energy ; // eV
53+ double const eloss = 2.0 / 3.0 * classical_radius * length * beta_gamma * beta_gamma * beta_gamma * h * h * energy ; // eV
5154
5255 // apply the energy kick
53- LocalParticle_add_to_energy (part , - eloss );
56+ //LocalParticle_add_to_energy(part, -eloss);
57+ LocalParticle_add_to_energy (part , 0. );
5458
55- // random number generator test
56- uint32_t s1 , s2 , s3 ;
57- rng_set (& s1 , & s2 , & s3 , 1234 );
59+ double r = LocalParticle_generate_random_double (part );
5860
59- LocalParticle_set___rng_s1 (part , s1 );
60- LocalParticle_set___rng_s2 (part , s2 );
61- LocalParticle_set___rng_s3 (part , s3 );
62-
63- /* uint32_t */ s1 = LocalParticle_get___rng_s1 (part );
64- /* uint32_t */ s2 = LocalParticle_get___rng_s2 (part );
65- /* uint32_t */ s3 = LocalParticle_get___rng_s3 (part );
66-
67- for (int i = 0 ; i < 3 ; i ++ ) {
68- double r = rng_get (& s1 , & s2 , & s3 );
69- printf ("rnd = %g\n" , r );
70- }
7161 }
7262
7363 if ( ( hxl > 0 ) || ( hyl > 0 ) || ( hxl < 0 ) || ( hyl < 0 ) )
0 commit comments