-
Notifications
You must be signed in to change notification settings - Fork 31
ConstF: Allow kx<0 and ky<0 #1041
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?
Conversation
|
@kyrsjo I don't see an element exactly analogous to this one in the MAD-X documentation. However, (at least for the transverse focusing), the closest analogy is the SOLENOID. If the rotation in x-y is ignored, then the solenoid provides equal focusing in x/y with strength k=Bz/Brho, following the convention defined here. In other words, the focusing field strength normalized by Brho. |
src/elements/ConstF.H
Outdated
| m_cos_kyds = cos_kyds; | ||
| m_const_y = -m_ky * sin_kyds; | ||
| // Note: The convention here is m_kx[1/m] = sign(k)*sqrt(abs(k)) | ||
| // where k[1/m^2] is in the usual MADX convention |
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 statement is not clear, since there is not direct MADX analog. For solenoids, the focusing strength is k [1/m].
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.
I was mainly thinking that this is a strong analog to quadrupole mangets and plasma lenses, since the equations are exactly the same*, and there is no rotation implemented between the horizontal/vertical plane? So providing the conversion explicitly to the units used for quadrupoles makes sense IMO.
* Except for the convention of how k works.
src/elements/ConstF.H
Outdated
| auto const [sin_kyds, cos_kyds] = amrex::Math::sincos(m_ky * slice_ds); | ||
| amrex::ParticleReal const_y = -m_ky * sin_kyds; | ||
| // Note: The convention here is m_kx[1/m] = sign(k)*sqrt(abs(k)) | ||
| // where k[1/m^2] is in the usual MADX convention |
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.
See the comment above.
|
This looks great; thanks a lot! I made only a minor comment. It looks ready to go once a simple test is added. Let us know if you would like some help with this. |
|
Hi, that's great! I'm on summer holiday right now, will be back in August. I can look at it then, or if you want to add the test and merge, please feel free! Thanks again for all the help - it makes it a lot more likely that I will contribute again, and now I know your setup and standards! |
|
Basically in |
|
In tests, also look at this for how I get the data out:
Relative to: |
for more information, see https://pre-commit.ci
…ied, as suggested by Axel Huebel in BLAST-ImpactX#1030 (comment)
…ve_plasma_lens examples
|
TODO's above are FIXED. |
for more information, see https://pre-commit.ci
…le they were passing when running through CTest they were (barely) failing when ran directly. Different seeding maybe?
for more information, see https://pre-commit.ci
|
@ax3l How do I add figures to the documentation like in https://impactx.readthedocs.io/en/latest/usage/examples/optimize_triplet/README.html#visualize ? |
…e particles, small bugfixes related to ConstF
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
|
It looks like these tests are failing due to errors in the test system on GitHub, not in the actual tests. |
for more information, see https://pre-commit.ci
…nce is that it is conserved)
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
|
Seems like the pre-commit wanted the exact opposite order of imports as me. Oh well, I just wanted them that way for readability (there is a logical order), but standards are standards I guess... |
for more information, see https://pre-commit.ci
Seems like I can just commit it and reference it in the .rst, just like for code examples... See eg. 8f59642 Why is this not done other places? Why use out-of-repo gists? |
|
@cemitch99 I think this is now ready to merge? |
This adds support for negative focusing strengths
kxandkyfor the elementConstF.It also significantly updates the example
active_plasma_lens, demonstrating bothConstFandChrPlasmaLenselements and added in PR #1030. The CTest setup for this example was also simplified, avoiding needlessly copying files.Finally, I signed my name to the top of both
ConstF.HandChrPlasmaLens.H, as was previously suggested.Original top comment: