-
Notifications
You must be signed in to change notification settings - Fork 75
Pass plasma extent to Particles and ContinuousInjector #537
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
base: dev
Are you sure you want to change the base?
Conversation
…ousInjector objects. This prevents the ContinuousInjector from creating particles when the loading region is outside the plasma extent.
RemiLehe
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.
Thanks for this PR!
It seems that some tests are not passing ; I suggest a change which might fix that (hopefully).
|
Hi Remi, I had to modify I have reverted to this implementation (which exploits short-circuit evaluation): Npz = 0 if (self.p_extent is not None and len(self.p_extent)>1 \
and (zmax < self.p_extent[0] or zmin > self.p_extent[1])) \
else self.nz_injectbut I would be happy to split it into nested |
|
Sorry for the very late review! |
This PR passes the user-defined plasma extent (
p_zminandp_zmax) on to theParticlesandContinuousInjectorclasses. The values passed currently have been modified to within the initial domain. This change allows the continuous injector to check whether the loading region is within the plasma extent before creating particles that are eventually ignored due to having zero weight. This can save a lot of time for short plasma species with many particles per cell.