Skip to content
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

Transverse Alignment Support #490

Merged
merged 9 commits into from
Jan 3, 2024

Conversation

ax3l
Copy link
Member

@ax3l ax3l commented Dec 21, 2023

Add support for non-ideal transverse alignment in elements.

This adds horizontal and vertical translation offsets per element as well as rotation in the x-y plane.

Checklist

  • add new mixin helper class Alignment
  • use in elements that support it
  • initialize in inputs files & Python API
  • document
  • test case

@ax3l ax3l added the component: elements Elements/external fields label Dec 21, 2023
@ax3l ax3l requested a review from cemitch99 December 21, 2023 10:00
@ax3l ax3l force-pushed the topic-alignment-errors branch 4 times, most recently from c166bf0 to 0ac6c91 Compare December 21, 2023 12:27
@@ -65,9 +65,9 @@ Usage
:hidden:

usage/how_to_run
usage/examples
Copy link
Member Author

@ax3l ax3l Dec 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved forward as in WarpX: showing examples before API details feels more user-friendly :)

@ax3l ax3l force-pushed the topic-alignment-errors branch from 0ac6c91 to a24cd13 Compare December 21, 2023 12:52
@ax3l ax3l requested a review from qianglbl December 21, 2023 12:53
@ax3l ax3l force-pushed the topic-alignment-errors branch from a24cd13 to 98785cc Compare December 21, 2023 13:04
src/python/elements.cpp Outdated Show resolved Hide resolved
Copy link
Member

@cemitch99 cemitch99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made some suggestions, especially to avoid mixing variable values in new/old coordinate system.

In general, "Transversal" is usually written as "Transverse".

Don't we also need to modify InitElement.cpp? Could also be a follow-up.

@ax3l
Copy link
Member Author

ax3l commented Dec 21, 2023

Thanks for the review comments!

Don't we also need to modify InitElement.cpp? Could also be a follow-up.

src/initialization/InitElement.cpp is modified, but it is a bigger change and has to be expanded manually in the Files changed tab when you click on it.

@ax3l ax3l force-pushed the topic-alignment-errors branch 2 times, most recently from 34c9813 to 17a358a Compare December 21, 2023 22:07
@ax3l ax3l requested a review from cemitch99 December 21, 2023 23:09
Copy link
Member

@cemitch99 cemitch99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a test example in mind with parameters we can try. I'll copy your branch and try to get this working tomorrow morning.

@ax3l ax3l changed the title Transversal Alignment Support Transverse Alignment Support Dec 22, 2023
@ax3l ax3l force-pushed the topic-alignment-errors branch from 28c6555 to a90c64f Compare December 23, 2023 21:49
@ax3l ax3l requested a review from cemitch99 December 23, 2023 21:55
src/particles/elements/Buncher.H Outdated Show resolved Hide resolved
src/particles/elements/CFbend.H Outdated Show resolved Hide resolved
src/particles/elements/ChrDrift.H Outdated Show resolved Hide resolved
src/particles/elements/ChrQuad.H Outdated Show resolved Hide resolved
src/particles/elements/ChrUniformAcc.H Outdated Show resolved Hide resolved
src/particles/elements/ShortRF.H Outdated Show resolved Hide resolved
src/particles/elements/SoftQuad.H Outdated Show resolved Hide resolved
src/particles/elements/SoftSol.H Outdated Show resolved Hide resolved
src/particles/elements/Sol.H Outdated Show resolved Hide resolved
src/particles/elements/ThinDipole.H Outdated Show resolved Hide resolved
@ax3l ax3l force-pushed the topic-alignment-errors branch 2 times, most recently from 715b8dc to 9de793d Compare December 24, 2023 11:20
@ax3l ax3l force-pushed the topic-alignment-errors branch from 0f17351 to ef51e58 Compare January 3, 2024 19:55
ax3l and others added 9 commits January 3, 2024 12:16
Create a mixin class that can be used for transversal alignment
offsets and tilts.

Co-authored-by: Chad Mitchell <chadmitchell@lbl.gov>
Co-authored-by: Chad Mitchell <chadmitchell@lbl.gov>
Now: `rotation error in the transverse plane`
@ax3l ax3l force-pushed the topic-alignment-errors branch from c716af1 to 1f9d23a Compare January 3, 2024 20:19
Copy link
Member

@cemitch99 cemitch99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great. In the end, the code change to each individual element is minor and easily duplicated.

@ax3l
Copy link
Member Author

ax3l commented Jan 3, 2024

Thanks! Yes, that's the idea.

Another cool property of this mixin class approach is, that we see from the type of a class if it can be misaligned or not.

If we need it later on, we can also add an explicit alignment element from this mixin class, but currently this seems to a user friendly way to expose it in each element (and the calculation is nicely fused in the kernel that does the map advance).

@ax3l ax3l merged commit 0cc637c into ECP-WarpX:development Jan 3, 2024
15 checks passed
@ax3l ax3l deleted the topic-alignment-errors branch January 3, 2024 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: elements Elements/external fields
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants