w
should be the actual particle weight
#98
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In the code before this PR, the particle quantity
w
represented different things:neutral_weight
) to store the actual number of physical particle per macroparticle, inside theIonizer
class.This is confusing, and therefore the current pull request sets
w
to be the actual weight (i.e. number of physical particle per macroparticle) for both non-ionizable particles and ionizable particles.w
has to be multiplied by the charge inside the deposition kernel (this is a minor cost)w
now plays the part thatneutral_weight
used to play. And therefore, inside the Ionizer class,neutral_weight
is replaced by a new arrayw_times_level
, which is only used for the deposition kernel, as the effective weight.Note that a lot of the changes involve replacing
neutral_weight
byw_times_level
in all the MPI communications. The code for the MPI communications of these optional quantities (e.g.w_times_level
,ionization_level
, etc.) is quite ugly, and should at some point be replaced by something better.PS: In fact,
w_times_level
does not need to be communicated via MPI, since it can be recalculated at eachexchange_period
, fromw
andionization_level
. I kept the MPI communications mostly to minimize the changes in the code that this PR produces.