Skip to content

Commit

Permalink
Use ion_sources directly instead of counter to set up electron sources
Browse files Browse the repository at this point in the history
`counter` is not the same as `length(ion_sources)` when one or more ion
source sections are found. It is simpler to directly iterate over
`ion_sources`.
  • Loading branch information
johnomotani committed Sep 12, 2024
1 parent d4dd565 commit e8f2926
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions moment_kinetics/src/external_sources.jl
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,9 @@ function setup_external_sources!(input_dict, r, z, electron_physics)
electron_sources = electron_source_data[]
if electron_physics (braginskii_fluid, kinetic_electrons,
kinetic_electrons_with_temperature_equation)
electron_sources = [get_settings_electrons(ion_sources[i]) for i 1:counter]
electron_sources = [get_settings_electrons(this_source) for this_source ion_sources]
else
electron_sources = [get_settings_electrons(get_settings_ions(1, false)) for i 1:counter]
electron_sources = [get_settings_electrons(get_settings_ions(1, false))]
end

# put all neutral sources into neutral_source_data struct vector
Expand Down

0 comments on commit e8f2926

Please sign in to comment.