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

Add MADX Input Parser #214

Merged
merged 19 commits into from
Sep 2, 2022
Merged

Add MADX Input Parser #214

merged 19 commits into from
Sep 2, 2022

Conversation

n01r
Copy link
Member

@n01r n01r commented Aug 25, 2022

This PR adds a first MAD-X (Methodical Accelerator Design) input capability to ImpactX (#104).
We use the pymadxparser that Andreas Adelmann (PSI) generously made available for us. 🎉

  • create free-standing function madx_to_impactx
  • import MADX parser and translation function correctly with __init__.py
  • make FODO run with MADX
  • make the automated FODO test work (still doesn't find the input file)
  • create standards for MADX' available particle species and read charge and mass from these?

Follow-up features

  • parse Fortran number formats (e.g. 40.d-3)
  • implement missing elements
  • make inline calculations work
  • create a useful intermediate representation that can be exported to other formats
  • visualize the lattice representation

@n01r n01r marked this pull request as draft August 25, 2022 01:21
examples/CMakeLists.txt Outdated Show resolved Hide resolved
@n01r
Copy link
Member Author

n01r commented Aug 26, 2022

Hey @ax3l, should I make the chicane input look like the one from input_chicane.in as well?

Also, the FODO/chicane_MADX.py.run and the FODO/chicane_MADX.py.analysis are successful but the plot tests are not. Any advice?

@n01r n01r changed the title [WIP] Add MADX Input Parser Add MADX Input Parser Aug 29, 2022
@n01r n01r marked this pull request as ready for review August 29, 2022 20:42
@ax3l ax3l added changes input scripts / defaults Changes the syntax or meaning of input scripts and/or defaults component: python Python bindings component: elements Elements/external fields labels Aug 29, 2022
@n01r n01r added this to the Beta Release Version milestone Aug 29, 2022
@ax3l
Copy link
Member

ax3l commented Aug 30, 2022

@n01r as discussed yesterday, can you please adjust the .madx file to fit the numerical parameters of the checked in chicane example?

@ax3l ax3l self-assigned this Aug 30, 2022
examples/CMakeLists.txt Outdated Show resolved Hide resolved
examples/CMakeLists.txt Outdated Show resolved Hide resolved
examples/CMakeLists.txt Outdated Show resolved Hide resolved
examples/CMakeLists.txt Outdated Show resolved Hide resolved
Comment on lines 6 to 8
! TODO make this work with inline calculations
! theta=pi/10.;
! TODO put theta again everywhere after `angle=` with its right sign
Copy link
Member

Choose a reason for hiding this comment

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

cc @np-eazy fyi :)

src/python/impactx/MADXParser.py Outdated Show resolved Hide resolved
src/python/impactx/madx_to_impactx.py Outdated Show resolved Hide resolved
@ax3l ax3l force-pushed the topic-addMADXParser branch 5 times, most recently from c2a7738 to f6cf8eb Compare August 31, 2022 00:03
@ax3l ax3l force-pushed the topic-addMADXParser branch 3 times, most recently from 8251e74 to 39a735b Compare August 31, 2022 06:37
@ax3l ax3l force-pushed the topic-addMADXParser branch from 39a735b to f88d685 Compare August 31, 2022 06:42
to avoid matching of `drift` in `use, sequence` line with parser.
@n01r n01r force-pushed the topic-addMADXParser branch from 6f75edf to 1260242 Compare September 1, 2022 01:37
change MADXParser Quad type to Quadrupole to stay consistent with
MADX input
@n01r n01r force-pushed the topic-addMADXParser branch from 1260242 to 5f80f37 Compare September 1, 2022 01:40
Confirmed today via email :)
Copy link
Member

@ax3l ax3l left a comment

Choose a reason for hiding this comment

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

🚀 ✨

@ax3l ax3l enabled auto-merge (squash) September 1, 2022 01:56
@ax3l ax3l disabled auto-merge September 1, 2022 01:56
@ax3l ax3l enabled auto-merge (squash) September 1, 2022 01:57
@ax3l ax3l disabled auto-merge September 1, 2022 01:57
@ax3l ax3l enabled auto-merge (squash) September 1, 2022 01:58
@ax3l ax3l disabled auto-merge September 1, 2022 02:06
@ax3l ax3l enabled auto-merge (squash) September 2, 2022 01:22
@ax3l ax3l merged commit e5dabe5 into ECP-WarpX:development Sep 2, 2022
@n01r n01r deleted the topic-addMADXParser branch September 2, 2022 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes input scripts / defaults Changes the syntax or meaning of input scripts and/or defaults component: elements Elements/external fields component: python Python bindings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants