routine to instantiate an impactx lattice based on a synergia lattice#1271
routine to instantiate an impactx lattice based on a synergia lattice#1271egstern wants to merge 39 commits into
Conversation
There was a problem hiding this comment.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
|
Great! Thanks for sharing! |
the value for what MAD-X called FINT is no longer the fourth argument so all the calls need to be updated.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
| ) | ||
|
|
||
| return ocelem | ||
|
|
Check warning
Code scanning / CodeQL
Unnecessary pass Warning
| # only do linear bend | ||
| main_bend_elem = impactx.elements.CFbend( | ||
| ds, radius_of_curvature, k1, nslice=ns, name=nm | ||
| ) |
Check warning
Code scanning / CodeQL
Unnecessary pass Warning
| else: | ||
| # CF bend | ||
|
|
||
| if order == Order.linear: |
Check warning
Code scanning / CodeQL
Unnecessary pass Warning
| ) | ||
| else: | ||
| phi = bendangle * 180 / np.pi | ||
| main_bend_elem = impactx.elements.ExactSbend(ds, phi, nslice=ns, name=nm) |
Check warning
Code scanning / CodeQL
Unnecessary pass Warning
| de_model = "linear" | ||
|
|
||
| if e1 != 0.0: | ||
| us_dipedge = impactx.elements.DipEdge( |
Check warning
Code scanning / CodeQL
Unnecessary pass Warning
cemitch99
left a comment
There was a problem hiding this comment.
It looks like one feature still needed for this PR is documentation in a README.
closely match Synergia.
for more information, see https://pre-commit.ci
| model="linear", | ||
| name=nm + "_usedge", | ||
| ) | ||
| pass |
Check warning
Code scanning / CodeQL
Unnecessary pass Warning
linter complaints.
for more information, see https://pre-commit.ci
| 2 * hgap, | ||
| K2=fint, | ||
| location="entry", | ||
| model=de_model, |
Check failure
Code scanning / CodeQL
Potentially uninitialized local variable Error
| 2 * hgap, | ||
| K2=fint, | ||
| location="exit", | ||
| model=de_model, |
Check failure
Code scanning / CodeQL
Potentially uninitialized local variable Error
| radius_of_curvature, | ||
| 2 * hgap, | ||
| K2=fint, | ||
| model=de_model, |
Check failure
Code scanning / CodeQL
Potentially uninitialized local variable Error
| radius_of_curvature, | ||
| 2 * hgap, | ||
| K2=fint, | ||
| model=de_model, |
Check failure
Code scanning / CodeQL
Potentially uninitialized local variable Error
2) A script that parses the lattice with Synergia, converts to ImpactX
format with syn2_to_impactx and runs a simulation.
for more information, see https://pre-commit.ci
…der with parser into ImpactX.
IMPACTX_SYNMADX.
Merge branch 'import_synergia_madx_parser' into parse_madx_lattice_get_parser
Start fixing example to use synmadx parser without Synergia
9a1e4af to
fa61eba
Compare
reading from a particle source
for more information, see https://pre-commit.ci
Add dependencies conditional on the fla ImpactX_synmadx
…a tree
Remove the following unused Synergia subdirectories that are not required
to build MadX_reader:
- synergia/bunch/
- synergia/collective/
- synergia/libFF/
- synergia/optics/
- synergia/simulation/
- synergia/tools/
(368 files total)
Decouple the remaining root synergia/ tree by vendoring bundled Boost
headers locally into src/synmadx/synergia/utils/boost/. Update synmadx
include path from ${CMAKE_SOURCE_DIR}/synergia/utils to
${CMAKE_CURRENT_SOURCE_DIR}/synergia/utils to use the local vendored copy.
Remove remaining root synergia/foundation/, synergia/lattice/,
synergia/utils/, and root management files (CMakeLists.txt, __init__.py,
version.py.in, .gitignore).
Verify synmadx builds and all 4 tests pass after decoupling:
- synmadx.test_lattice
- synmadx.test_dynamic_lattice
- synmadx.test_madx_parser
- synmadx.test_mx_expr
Synmadx is now fully standalone with all dependencies either bundled
or inherited from the ImpactX CMake layer (pybind11, C++ std lib).
| ref.set_kin_energy_MeV(kin_energy) | ||
|
|
||
| # charge to mass ratio | ||
| qm_eev = 1.0 / (1.0e-9 * mp) |
Check notice
Code scanning / CodeQL
Unused local variable Note
|
|
||
| if enable_rf: | ||
| lattice_with_rf = set_rf( | ||
| lattice_raw, |
Check notice
Code scanning / CodeQL
Unused local variable Note
|
@ax3l The first failure is because the name of the author in an included Boost header is European and has a non-ASCII character in their name which just appears in a comment. As a European, how do you feel about flagging this as an error? |
This is the start of an example that demonstrates converting a lattice parsed in Synergia from a MAD-X into an ImpactX lattice.