File tree Expand file tree Collapse file tree 6 files changed +63
-0
lines changed Expand file tree Collapse file tree 6 files changed +63
-0
lines changed Original file line number Diff line number Diff line change @@ -307,6 +307,13 @@ SUBROUTINE run_single_injector(injector)
307307#ifndef PER_SPECIES_WEIGHT
308308 density = MIN (density, injector% density_max)
309309 new% weight = weight_fac * density
310+ #endif
311+ #if defined(PHOTONS) || defined(BREMSSTRAHLUNG)
312+ ! For photons, assign additional variable used in photon particle-push
313+ IF (species_list(injector% species)% species_type == c_species_id_photon) &
314+ THEN
315+ new% particle_energy = SQRT (SUM (new% part_p** 2 )) * c
316+ END IF
310317#endif
311318 CALL add_particle_to_partlist(plist, new)
312319 END DO
Original file line number Diff line number Diff line change @@ -92,6 +92,9 @@ SUBROUTINE auto_load
9292 TYPE (particle_species), POINTER :: species
9393 INTEGER :: i0, i1, iu, io
9494 TYPE (initial_condition_block), POINTER :: ic
95+ #if defined(PHOTONS) || defined(BREMSSTRAHLUNG)
96+ TYPE (particle), POINTER :: current
97+ #endif
9598
9699 IF (pre_loading .AND. n_species > 0 ) THEN
97100 i0 = 1 - ng
@@ -141,6 +144,17 @@ SUBROUTINE auto_load
141144 ELSE IF (species% ic_df_type == c_ic_df_arbitrary) THEN
142145 CALL setup_particle_dist_fn(species, species_drift)
143146 END IF
147+
148+ #if defined(PHOTONS) || defined(BREMSSTRAHLUNG)
149+ ! For photons, assign additional variable used in photon particle-push
150+ IF (species_list(ispecies)% species_type == c_species_id_photon) THEN
151+ current = > species% attached_list% head
152+ DO WHILE (ASSOCIATED (current))
153+ current% particle_energy = SQRT (SUM (current% part_p** 2 )) * c
154+ current = > current% next
155+ END DO
156+ END IF
157+ #endif
144158 END DO
145159
146160 IF (pre_loading) RETURN
Original file line number Diff line number Diff line change @@ -366,6 +366,13 @@ SUBROUTINE run_single_injector(injector)
366366#ifndef PER_SPECIES_WEIGHT
367367 density = MIN (density, injector% density_max)
368368 new% weight = weight_fac * density
369+ #endif
370+ #if defined(PHOTONS) || defined(BREMSSTRAHLUNG)
371+ ! For photons, assign additional variable used in photon particle-push
372+ IF (species_list(injector% species)% species_type == c_species_id_photon) &
373+ THEN
374+ new% particle_energy = SQRT (SUM (new% part_p** 2 )) * c
375+ END IF
369376#endif
370377 CALL add_particle_to_partlist(plist, new)
371378 END DO
Original file line number Diff line number Diff line change @@ -98,6 +98,9 @@ SUBROUTINE auto_load
9898 TYPE (particle_species), POINTER :: species
9999 INTEGER :: i0, i1, iu, io
100100 TYPE (initial_condition_block), POINTER :: ic
101+ #if defined(PHOTONS) || defined(BREMSSTRAHLUNG)
102+ TYPE (particle), POINTER :: current
103+ #endif
101104
102105 IF (pre_loading .AND. n_species > 0 ) THEN
103106 i0 = 1 - ng
@@ -147,6 +150,17 @@ SUBROUTINE auto_load
147150 ELSE IF (species% ic_df_type == c_ic_df_arbitrary) THEN
148151 CALL setup_particle_dist_fn(species, species_drift)
149152 END IF
153+
154+ #if defined(PHOTONS) || defined(BREMSSTRAHLUNG)
155+ ! For photons, assign additional variable used in photon particle-push
156+ IF (species_list(ispecies)% species_type == c_species_id_photon) THEN
157+ current = > species% attached_list% head
158+ DO WHILE (ASSOCIATED (current))
159+ current% particle_energy = SQRT (SUM (current% part_p** 2 )) * c
160+ current = > current% next
161+ END DO
162+ END IF
163+ #endif
150164 END DO
151165
152166 IF (pre_loading) RETURN
Original file line number Diff line number Diff line change @@ -403,6 +403,13 @@ SUBROUTINE run_single_injector(injector)
403403#ifndef PER_SPECIES_WEIGHT
404404 density = MIN (density, injector% density_max)
405405 new% weight = weight_fac * density
406+ #endif
407+ #if defined(PHOTONS) || defined(BREMSSTRAHLUNG)
408+ ! For photons, assign additional variable used in photon particle-push
409+ IF (species_list(injector% species)% species_type == c_species_id_photon) &
410+ THEN
411+ new% particle_energy = SQRT (SUM (new% part_p** 2 )) * c
412+ END IF
406413#endif
407414 CALL add_particle_to_partlist(plist, new)
408415 END DO
Original file line number Diff line number Diff line change @@ -104,6 +104,9 @@ SUBROUTINE auto_load
104104 TYPE (particle_species), POINTER :: species
105105 INTEGER :: i0, i1, iu, io
106106 TYPE (initial_condition_block), POINTER :: ic
107+ #if defined(PHOTONS) || defined(BREMSSTRAHLUNG)
108+ TYPE (particle), POINTER :: current
109+ #endif
107110
108111 IF (pre_loading .AND. n_species > 0 ) THEN
109112 i0 = 1 - ng
@@ -153,6 +156,17 @@ SUBROUTINE auto_load
153156 ELSE IF (species% ic_df_type == c_ic_df_arbitrary) THEN
154157 CALL setup_particle_dist_fn(species, species_drift)
155158 END IF
159+
160+ #if defined(PHOTONS) || defined(BREMSSTRAHLUNG)
161+ ! For photons, assign additional variable used in photon particle-push
162+ IF (species_list(ispecies)% species_type == c_species_id_photon) THEN
163+ current = > species% attached_list% head
164+ DO WHILE (ASSOCIATED (current))
165+ current% particle_energy = SQRT (SUM (current% part_p** 2 )) * c
166+ current = > current% next
167+ END DO
168+ END IF
169+ #endif
156170 END DO
157171
158172 IF (pre_loading) RETURN
You can’t perform that action at this time.
0 commit comments