-
Notifications
You must be signed in to change notification settings - Fork 202
Feature lenses x y #4305
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: development
Are you sure you want to change the base?
Feature lenses x y #4305
Conversation
self.warpx_strengths_Bx = warpx_strengths_Bx | ||
self.warpx_strengths_By = warpx_strengths_By | ||
|
||
assert (self.strengths_E is not None) or (self.strengths_B is not None)\ |
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 check is not needed here since the same check is done in C++.
pywarpx.particles.repeated_plasma_lens_strengths_E = self.strengths_E | ||
pywarpx.particles.repeated_plasma_lens_strengths_B = self.strengths_B | ||
if self.warpx_strengths_Ex is not None or self.warpx_strengths_Ey is not None: | ||
print('Using Ex and Ey, ignoring \'strengths_E\' if provided',flush=True) |
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.
Is this print statement needed, or is this left over from debugging?
BTW, a handy trick in Python is to take advantage of single and double quotes.
print('Using Ex and Ey, ignoring "strengths_E" if provided',flush=True)
Also, the if
statement is not needed. The three variables can be directly assigned. Anything set to None
is ignored when the parameters are processed.
pywarpx.particles.repeated_plasma_lens_strengths_Ex = self.warpx_strengths_Ex
pywarpx.particles.repeated_plasma_lens_strengths_Ey = self.warpx_strengths_Ey
pywarpx.particles.repeated_plasma_lens_strengths_E = self.strengths_E
And the same for B
@@ -22,25 +22,39 @@ void init_MultiParticleContainer (py::module& m) | |||
) | |||
|
|||
.def("set_plasma_lens_strength", |
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.
There should be two versions of set_plasma_lens_strength, the original one with two arguments and the new one with four.
214dd40
to
4984c20
Compare
4984c20
to
cca924b
Compare
Thanks for your comments @dpgrote ! I haven't finished checking or documenting this and then it fell by the wayside (as happens so often...). Hopefully I get to finishing the test in the near future |
This PR modifies the periodic plasma lens to allow for separate lens strengths in x and y.
TODO