-
Notifications
You must be signed in to change notification settings - Fork 230
Rigid injection: Center field scaling around the v push #5389
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
Rigid injection: Center field scaling around the v push #5389
Conversation
|
|
||
| amrex::ParticleReal* AMREX_RESTRICT x_save = xp_save.dataPtr(); | ||
| amrex::ParticleReal* AMREX_RESTRICT y_save = yp_save.dataPtr(); | ||
| amrex::ParticleReal* AMREX_RESTRICT z_save = zp_save.dataPtr(); |
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.
Saving and re-setting u to its original value is not needed anymore since the scaling factor for E and B is 0 for particles to the left of the plane.
4b430f1 to
f6e4566
Compare
| // If the particle stays to the left of the plane during the | ||
| // whole push, simply set the scaling factor to 0. | ||
| if (dtscale < 0._rt) { | ||
| dtscale = 0; |
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.
Perhaps add a comment that since the scale factor is zero, the push of the velocity doesn't change the velocity.
dpgrote
left a comment
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.
This looks good. I approve, but have one suggestion for a comment to add.
In the rigid injection, the fields where scale by the fraction of time spent between
n*dtand(n+1)*dtto the right of the injection plane. However, to be consistent with the leap-frog velocity update, this needs to be between(n-1/2)*dtand(n+1/2)*dtinstead.As a side-effect of this PR, saving and re-setting
uandoptical_depthto their original value is not needed anymore since the scaling factor for E and B is 0 for particles to the left of the plane.