diff --git a/bmad/code/write_lattice_in_foreign_format.f90 b/bmad/code/write_lattice_in_foreign_format.f90 index 60f6004e03..b169e30d6e 100644 --- a/bmad/code/write_lattice_in_foreign_format.f90 +++ b/bmad/code/write_lattice_in_foreign_format.f90 @@ -675,6 +675,11 @@ subroutine write_lattice_in_foreign_format (out_type, out_file_name, lat, ref_or bmad_params(:1) = [character(40):: 'l'] elegant_params(:1) = [character(40):: 'l'] + case (gkicker$) + write (line_out, '(2a)') trim(ele%name) // ': malign' + bmad_params(:6) = [character(40):: 'x_kick', 'y_kick', 'z_kick', 'px_kick', 'py_kick', 'pz_kick'] + elegant_params(:6) = [character(40):: 'dx', 'dy', 'dz', 'dxp', 'dyp', 'dp'] + case (hkicker$) ! Elegant write (line_out, '(2a)') trim(ele%name) // ': ehkick' bmad_params(:6) = [character(40):: 'l', 'kick', 'tilt', 'x_offset', 'y_offset', 'z_offset'] diff --git a/bmad/doc/cover-page.tex b/bmad/doc/cover-page.tex index faa1b2b05d..1d0667ab2b 100644 --- a/bmad/doc/cover-page.tex +++ b/bmad/doc/cover-page.tex @@ -3,7 +3,7 @@ \begin{flushright} \large - Revision: September 30, 2023 \\ + Revision: October 3, 2023 \\ \end{flushright} \pdfbookmark[0]{Preamble}{Preamble} diff --git a/bmad/doc/param-statements.tex b/bmad/doc/param-statements.tex index 5b7d9e87de..dc6fa04cfd 100644 --- a/bmad/doc/param-statements.tex +++ b/bmad/doc/param-statements.tex @@ -209,9 +209,6 @@ \section{Particle_Start Statements} particle_start[spin_x] = ! Spin polarization x-coordinate particle_start[spin_y] = ! Spin polarization y-coordinate particle_start[spin_z] = ! Spin polarization z-coordinate - particle_start[spin_dn_dpz_x] = ! Spin dn/dpz x-coordinate - particle_start[spin_dn_dpz_y] = ! Spin dn/dpz y-coordinate - particle_start[spin_dn_dpz_z] = ! Spin dn/dpz z-coordinate \end{example} Normally the absolute time, set by \vn{particle_start[t]}, is a dependent parameter set by solving \Eq{zbctt} for $t$. The exception is when the @@ -281,22 +278,26 @@ \section{Beginning and Line Parameter Statements} For non--circular lattices, the \vn{beginning} statement can be used to set the Twiss parameters and beam energy at the beginning of the first lattice branch. \begin{example} - beginning[alpha_a] = ! "a" mode alpha - beginning[alpha_b] = ! "b" mode alpha - beginning[beta_a] = ! "a" mode beta - beginning[beta_b] = ! "b" mode beta - beginning[cmat_ij] = ! C coupling matrix. i, j = \{``1'', or ``2''\} - beginning[mode_flip] = ! Set the mode flip status (\sref{s:coupling}). Default is False. - beginning[e_tot] = ! Reference total energy in eV. - beginning[eta_x] = ! x-axis dispersion - beginning[eta_y] = ! y-axis dispersion - beginning[etap_x] = ! x-axis dispersion derivative. - beginning[etap_y] = ! y-axis dispersion derivative. - beginning[p0c] = ! Reference momentum in eV. - beginning[phi_a] = ! "a" mode phase. - beginning[phi_b] = ! "b" mode phase. - beginning[ref_time] = ! Starting reference time. - beginning[s] = ! Longitudinal starting position. + beginning[alpha_a] = ! "a" mode alpha + beginning[alpha_b] = ! "b" mode alpha + beginning[beta_a] = ! "a" mode beta + beginning[beta_b] = ! "b" mode beta + beginning[cmat_ij] = ! C coupling matrix. i, j = \{``1'', or ``2''\} + beginning[mode_flip] = ! Set the mode flip status (\sref{s:coupling}). Default is False. + beginning[e_tot] = ! Reference total energy in eV. + beginning[eta_x] = ! x-axis dispersion + beginning[eta_y] = ! y-axis dispersion + beginning[etap_x] = ! x-axis dispersion derivative. + beginning[etap_y] = ! y-axis dispersion derivative. + beginning[p0c] = ! Reference momentum in eV. + beginning[phi_a] = ! "a" mode phase. + beginning[phi_b] = ! "b" mode phase. + beginning[ref_time] = ! Starting reference time. + beginning[s] = ! Longitudinal starting position. + beginning[spin_dn_dpz_x] = ! Spin dn/dpz x-coordinate + beginning[spin_dn_dpz_y] = ! Spin dn/dpz y-coordinate + beginning[spin_dn_dpz_z] = ! Spin dn/dpz z-coordinate + \end{example} \index{e_tot} The \vn{gamma_a}, \vn{gamma_b}, and \vn{gamma_c} (the coupling gamma factor) will be kept consistent diff --git a/tao/version/tao_version_mod.f90 b/tao/version/tao_version_mod.f90 index 1d74f7abd5..1c60818758 100644 --- a/tao/version/tao_version_mod.f90 +++ b/tao/version/tao_version_mod.f90 @@ -6,5 +6,5 @@ !- module tao_version_mod -character(*), parameter :: tao_version_date = "2023/09/30 14:19:56" +character(*), parameter :: tao_version_date = "2023/10/02 02:28:01" end module diff --git a/util_programs/elegant_to_bmad/elegant_to_bmad.py b/util_programs/elegant_to_bmad/elegant_to_bmad.py index 1b7bb1a5c7..a2d05deadd 100755 --- a/util_programs/elegant_to_bmad/elegant_to_bmad.py +++ b/util_programs/elegant_to_bmad/elegant_to_bmad.py @@ -127,7 +127,7 @@ def __init__(self): 'koct': 'octupole', 'center': 'patch', 'energy': 'patch', - 'malign': 'patch', + 'malign': 'gkicker', 'rotate': 'marker', # [exclude_floor != 0, exclude_optics != 0] # taylor [exclude_floor != 0, exclude_optics == 0] # floor_shift [exclude_floor == 0, exclude_optics != 0] @@ -600,9 +600,33 @@ def parse_element(dlist): for eparam in ele.param: ## if eparam in ['dx', 'dy', 'dz'] and 'etilt' in params: continue # Handled later - bparam = bmad_param(eparam, ele.name) - if bparam == '?': continue - if ele.bmad_type == 'drift' and bparam != 'l': continue + + # Malign -> Gkicker + + if ele.bmad_type == 'malign': + if eparam == 'dx': + bparam = 'x_kick' + elif eparam == 'dy': + bparam = 'y_kick' + elif eparam == 'dz': + bparam = 'z_kick' + elif eparam == 'dxp': + bparam = 'px_kick' + elif eparam == 'dyp': + bparam = 'py_kick' + elif eparam == 'dp': + bparam = 'pz_kick' + else: + bparam = '?' + + else: + bparam = bmad_param(eparam, ele.name) + if bparam == '?': continue + if ele.bmad_type == 'drift' and bparam != 'l': continue + endif + + # + value = postfix_to_infix(params[eparam]) if bparam == 'phi0':