-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Charge Deposition: Fix Sign #251
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
@ax3l It seems that you will need to modify the test to replace:
with
|
cb4cb8f
to
0117dfd
Compare
This fixes the charge deposition. Electrons should deposit negative charge :-)
0117dfd
to
ddb5de8
Compare
correct, wanted to quickly see if this fails now as intended. It does, but I also need to increase the tolerance a little now: |
This is a good point. In Impact-Z, the sign problem is avoided by treating all charges as positive. (So electrons are treated as positrons.) This makes life a bit easier, and it does not affect tracking in the external fields because the field strength is given in a normalized form (scaled by signed magnetic rigidity p/q). Either option is fine, as long as the sign of the pushed single-particle charge is the same as the sign of the deposited charge of the bunch. |
I like that we have both, would allow us to do some (short beamline) tests with partly neutral beams as come out from some plasma sources. |
This fixes the charge deposition. Electrons should deposit negative charge :-)