diff --git a/.github/workflows/dcs16_push.yml b/.github/workflows/dcs16_push.yml index df1797fc3f..6ca4ac6d05 100644 --- a/.github/workflows/dcs16_push.yml +++ b/.github/workflows/dcs16_push.yml @@ -13,6 +13,7 @@ env: # secrets.DCS_PUSH allows the ci.yml workflow to be triggered by this workflow. Documentation at: # https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs +# DCS_PUSH is defined: in bmad-ecosystem -> Settings -> Secrets and variables -> Actions jobs: create-pull-request: diff --git a/bmad/code/attribute_bookkeeper.f90 b/bmad/code/attribute_bookkeeper.f90 index 790c8691a6..75b538e10e 100644 --- a/bmad/code/attribute_bookkeeper.f90 +++ b/bmad/code/attribute_bookkeeper.f90 @@ -29,6 +29,7 @@ subroutine attribute_bookkeeper (ele, force_bookkeeping) use super_recipes_mod, only: super_brent use ptc_layout_mod, only: update_ele_from_fibre use taylor_mod, only: kill_taylor +use particle_species_mod implicit none @@ -40,6 +41,8 @@ subroutine attribute_bookkeeper (ele, force_bookkeeping) type (photon_element_struct), pointer :: ph type (wake_lr_mode_struct), pointer :: lr type (converter_prob_pc_r_struct), pointer :: ppcr +type (molecular_component_struct), allocatable :: component(:) +type (material_struct), pointer :: material real(rp) factor, e_factor, gc, f2, phase, E_tot, polarity, dval(num_ele_attrib$), time, beta real(rp) w_inv(3,3), len_old, f, dl, b_max, zmin, ky, kz @@ -48,7 +51,7 @@ subroutine attribute_bookkeeper (ele, force_bookkeeping) real(rp) kick_magnitude, bend_factor, quad_factor, radius0, step_info(7), dz_dl_max_err real(rp) a_pole(0:n_pole_maxx), b_pole(0:n_pole_maxx) -integer i, j, ix, ig, n, n_div, ixm, ix_pole_max, particle, geometry, i_max, status, material, z_material +integer i, j, ix, ig, n, n_div, ixm, ix_pole_max, particle, geometry, i_max, status, z_material character(20) :: r_name = 'attribute_bookkeeper' @@ -449,26 +452,39 @@ subroutine attribute_bookkeeper (ele, force_bookkeeping) case (foil$) - material = species_id(ele%component_name) - - if (ele%value(radiation_length$) == 0) then - ele%value(radiation_length_used$) = x0_radiation_length(material) - else - ele%value(radiation_length_used$) = ele%value(radiation_length$) + call molecular_components(ele%component_name, component) + n = size(component) + if (.not. allocated(ele%foil%material)) allocate(ele%foil%material(n)) + if (n /= size(ele%foil%material)) then + call out_io(s_error$, r_name, 'NUMBER OF COMPONENTS IN: ' // quote(ele%component_name) // ' (' // int_str(n) // & + ') IS NOT THE SAME AS OTHER PARAMETERS.') + if (global_com%exit_on_error) call err_exit + return endif - if (ele%value(density$) == 0) then - z_material = atomic_number(material) - ele%value(density_used$) = ElementDensity(z_material) * 1e3_rp ! From xraylib. Convert to kg/m^3 - else - ele%value(density_used$) = ele%value(density$) - endif + do ix = 1, n + material => ele%foil%material(ix) + material%species = species_id(component(ix)%atom) + z_material = atomic_number(material%species) - if (ele%value(thickness$) == 0) then - ele%value(area_density_used$) = ele%value(area_density$) - else - ele%value(area_density_used$) = ele%value(density_used$) * ele%value(thickness$) - endif + if (material%radiation_length == 0) then + material%radiation_length_used = x0_radiation_length(material%species) + else + material%radiation_length_used = material%radiation_length + endif + + if (material%density == 0) then + material%density_used = ElementDensity(z_material) * 1e3_rp ! From xraylib. Convert to kg/m^3 + else + material%density_used = material%density + endif + + if (ele%value(thickness$) == 0) then + material%area_density_used = material%area_density + else + material%area_density_used = material%density_used * ele%value(thickness$) + endif + enddo ! Crystal diff --git a/bmad/code/lat_sanity_check.f90 b/bmad/code/lat_sanity_check.f90 index 7599559259..91124fdfe3 100644 --- a/bmad/code/lat_sanity_check.f90 +++ b/bmad/code/lat_sanity_check.f90 @@ -600,13 +600,6 @@ subroutine lat_sanity_check (lat, err_flag) 'WHICH DOES NOT HAVE AN ASSOCIATED ATOMIC NUMBER.') err_flag = .true. endif - - if (ele%value(radiation_length_used$) == real_garbage$) then - call out_io(s_fatal$, r_name, & - 'ELEMENT: ' // ele_full_name(ele, '@N (&#)'), & - 'CANNOT HANDLE NON-ATOMIC MATERIAL_TYPE: ' // ele%component_name) - err_flag = .true. - endif endif ! Zero length cavity is verboten diff --git a/bmad/code/pointer_to_attribute.f90 b/bmad/code/pointer_to_attribute.f90 index d2383c65ef..ecf70651a7 100644 --- a/bmad/code/pointer_to_attribute.f90 +++ b/bmad/code/pointer_to_attribute.f90 @@ -722,7 +722,6 @@ subroutine pointer_to_attribute (ele, attrib_name, do_allocation, a_ptr, err_fla select case (a_name) ! attrib_type = is_real$ ! attrib_type = is_logical$ -case ('SCATTER'); a_ptr%r => ele%value(scatter$) case ('MATRIX'); a_ptr%r => ele%value(matrix$) case ('KICK0'); a_ptr%r => ele%value(kick0$) case ('FLEXIBLE'); a_ptr%r => ele%value(flexible$) @@ -771,6 +770,7 @@ subroutine pointer_to_attribute (ele, attrib_name, do_allocation, a_ptr, err_fla case ('PTC_FIELD_GEOMETRY'); a_ptr%r => ele%value(ptc_field_geometry$) case ('REF_ORBIT_FOLLOWS'); a_ptr%r => ele%value(ref_orbit_follows$) case ('REF_COORDS'); a_ptr%r => ele%value(ref_coords$) +case ('SCATTER_METHOD'); a_ptr%r => ele%value(scatter_method$) case ('SPACE_CHARGE_METHOD'); a_ptr%i => ele%space_charge_method case ('SPIN_TRACKING_METHOD'); a_ptr%i => ele%spin_tracking_method case ('TRACKING_METHOD'); a_ptr%i => ele%tracking_method diff --git a/bmad/code/type_ele.f90 b/bmad/code/type_ele.f90 index e6428241fa..bbc663e954 100644 --- a/bmad/code/type_ele.f90 +++ b/bmad/code/type_ele.f90 @@ -80,6 +80,7 @@ subroutine type_ele (ele, type_zero_attrib, type_mat6, type_taylor, twiss_out, t type (str_index_struct) str_index type (rad_map_struct), pointer :: rm0, rm1 type (photon_reflect_table_struct), pointer :: rt +type (material_struct), pointer :: matter integer, optional, intent(in) :: type_mat6, twiss_out, type_field integer, optional, intent(out) :: n_lines @@ -401,6 +402,27 @@ subroutine type_ele (ele, type_zero_attrib, type_mat6, type_taylor, twiss_out, t call encode_2nd_column_parameter (li, nl2, nl, 'REF_SPECIES', str_val = species_name(ele%ref_species)) endif +! Foil + +if (associated(ele%foil)) then + nl=nl+1; li(nl) = '' + nl=nl+1; li(nl) = 'Material_type: ' // ele%component_name + + do ix = 1, size(ele%foil%material) + matter = ele%foil%material(ix) + if (size(ele%foil%material) > 1) then + nl=nl+1; li(nl) = '' + nl=nl+1; li(nl) = 'Component: ' // species_name(matter%species) + endif + + nl=nl+1; write(li(nl), '(3(a, es14.6))') 'Density =', matter%density, & + 'Area_Density =', matter%area_density, 'Radiation_Length =', matter%radiation_length + nl=nl+1; write(li(nl), '(3(a, es14.6))') 'Density_Used =', matter%density_used, & + 'Area_Density_Used =', matter%area_density_used, 'Radiation_Length_Used =', matter%radiation_length_used + nl=nl+1; + enddo +endif + ! Converter if (associated(ele%converter)) then @@ -408,7 +430,7 @@ subroutine type_ele (ele, type_zero_attrib, type_mat6, type_taylor, twiss_out, t enddo endif -! Cartesian map +! Cartesian map. The type_field logical is useful since field tables can be very large. if (associated(ele%cartesian_map)) then if (integer_option(no$, type_field) == no$) then @@ -1453,10 +1475,11 @@ function is_2nd_column_attribute (ele, attrib_name, ix2_attrib) result (is_2nd_c 'PZ_APERTURE_WIDTH2', 'Z_APERTURE_WIDTH2', 'CMAT_11', 'CMAT_21', 'X_DISPERSION_ERR', & 'X_DISPERSION_CALIB', 'K1X', 'RF_FREQUENCY', 'UPSTREAM_ELE_DIR', 'SIG_X', & 'BETA_A0', 'BETA_B0', 'ALPHA_A0', 'ALPHA_B0', 'ETA_X0', 'ETAP_X0', 'X1_EDGE', 'Y1_EDGE', & - 'ETA_Y0', 'ETAP_Y0', 'KICK0', 'X0', 'PX0', 'Y0', 'PY0', 'Z0', 'PZ0', & + 'ETA_Y0', 'ETAP_Y0', 'KICK0', 'X0', 'PX0', 'Y0', 'PY0', 'Z0', 'PZ0', 'ATOMIC_WEIGHT', & 'C11_MAT0', 'C12_MAT0', 'C21_MAT0', 'C22_MAT0', 'HARMON', 'FINAL_CHARGE', & - 'MODE_FLIP0', 'BETA_A_STRONG', 'BETA_B_STRONG', 'REF_TIME_START', & - 'PX_KICK', 'PY_KICK', 'PZ_KICK', 'DENSITY', 'RADIATION_LENGTH', 'AREA_DENSITY'] + 'MODE_FLIP0', 'BETA_A_STRONG', 'BETA_B_STRONG', 'REF_TIME_START', 'THICKNESS', & + 'PX_KICK', 'PY_KICK', 'PZ_KICK', & + 'F_FACTOR'] character(41), parameter :: att2_name(91) = [character(40):: 'X_PITCH_TOT', 'Y_PITCH_TOT', 'X_OFFSET_TOT', & 'Y_OFFSET_TOT', 'Z_OFFSET_TOT', 'REF_TILT_TOT', 'TILT_TOT', 'ROLL_TOT', 'X2_LIMIT', 'Y2_LIMIT', & @@ -1468,10 +1491,11 @@ function is_2nd_column_attribute (ele, attrib_name, ix2_attrib) result (is_2nd_c 'PZ_APERTURE_CENTER', 'Z_APERTURE_CENTER', 'CMAT_12', 'CMAT_22', 'Y_DISPERSION_ERR', & 'Y_DISPERSION_CALIB', 'K1Y', 'RF_WAVELENGTH', 'DOWNSTREAM_ELE_DIR', 'SIG_Y', & 'BETA_A1', 'BETA_B1', 'ALPHA_A1', 'ALPHA_B1', 'ETA_X1', 'ETAP_X1', 'X2_EDGE', 'Y2_EDGE', & - 'ETA_Y1', 'ETAP_Y1', 'MATRIX', 'X1', 'PX1', 'Y1', 'PY1', 'Z1', 'PZ1', & + 'ETA_Y1', 'ETAP_Y1', 'MATRIX', 'X1', 'PX1', 'Y1', 'PY1', 'Z1', 'PZ1', 'Z_CHARGE', & 'C11_MAT1', 'C12_MAT1', 'C21_MAT1', 'C22_MAT1', 'HARMON_MASTER', 'SCATTER', & - 'MODE_FLIP1', 'ALPHA_A_STRONG', 'ALPHA_B_STRONG', 'DELTA_REF_TIME', & - 'X_KICK', 'Y_KICK', 'Z_KICK', 'DENSITY_USED', 'RADIATION_LENGTH_USED', 'AREA_DENSITY_USED'] + 'MODE_FLIP1', 'ALPHA_A_STRONG', 'ALPHA_B_STRONG', 'DELTA_REF_TIME', 'DREL_THICKNESS_DX', & + 'X_KICK', 'Y_KICK', 'Z_KICK', & + 'SCATTER_METHOD'] ! Exceptional cases @@ -1496,9 +1520,11 @@ function is_2nd_column_attribute (ele, attrib_name, ix2_attrib) result (is_2nd_c end select ! Is a 2nd column attribute if corresponding first column attribute exists +! Note: There are rare cases where the corresponding 1st column parameter does not exist for the particular element type. call match_word (attrib_name, att2_name, ix, .true., .false.) if (ix > 0) then + if (.not. has_attribute(ele, att_name(ix))) return ia = attribute_index(ele, att_name(ix)) is_2nd_col_attrib = (ia > 0) return @@ -1507,7 +1533,10 @@ function is_2nd_column_attribute (ele, attrib_name, ix2_attrib) result (is_2nd_c ! If the attribute has a corresponding 2nd column attribute, set ix2_attrib accordingly. call match_word (attrib_name, att_name, ix, .true., .false.) -if (ix > 0) ix2_attrib = attribute_index(ele, att2_name(ix)) +if (ix > 0) then + if (.not. has_attribute(ele, att2_name(ix))) return + ix2_attrib = attribute_index(ele, att2_name(ix)) +endif end function is_2nd_column_attribute diff --git a/bmad/code/write_bmad_lattice_file.f90 b/bmad/code/write_bmad_lattice_file.f90 index ed4990cbae..e83bfbd87b 100644 --- a/bmad/code/write_bmad_lattice_file.f90 +++ b/bmad/code/write_bmad_lattice_file.f90 @@ -79,6 +79,7 @@ subroutine write_bmad_lattice_file (bmad_file, lat, err, output_form, orbit0) type (expression_atom_struct), pointer :: stack(:) type (str_index_struct) str_index type (lat_ele_order_struct) order +type (material_struct), pointer :: material real(rp) s0, x_lim, y_lim, val, x, y @@ -534,6 +535,48 @@ subroutine write_bmad_lattice_file (bmad_file, lat, err, output_form, orbit0) line = trim(line) // '}' endif + ! Foil + + if (associated(ele%foil)) then + if (size(ele%foil%material) > 1) then + if (any(ele%foil%material%density /= 0)) then + line = trim(line) // ', density = (' + do n = 1, size(ele%foil%material) + if (n == 1) then; line = trim(line) // re_str(ele%foil%material(n)%density) + else; line = trim(line) // ', ' // re_str(ele%foil%material(n)%density) + endif + enddo + line = trim(line) // ')' + endif + + if (any(ele%foil%material%area_density /= 0)) then + line = trim(line) // ', area_density = (' + do n = 1, size(ele%foil%material) + if (n == 1) then; line = trim(line) // re_str(ele%foil%material(n)%area_density) + else; line = trim(line) // ', ' // re_str(ele%foil%material(n)%area_density) + endif + enddo + line = trim(line) // ')' + endif + + if (any(ele%foil%material%radiation_length /= 0)) then + line = trim(line) // ', radiation_length = (' + do n = 1, size(ele%foil%material) + if (n == 1) then; line = trim(line) // re_str(ele%foil%material(n)%radiation_length) + else; line = trim(line) // ', ' // re_str(ele%foil%material(n)%radiation_length) + endif + enddo + line = trim(line) // ')' + endif + + else + material => ele%foil%material(1) + if (material%density /= 0) line = trim(line) // ', density = ' // re_str(material%density) + if (material%area_density /= 0) line = trim(line) // ', area_density = ' // re_str(material%area_density) + if (material%radiation_length /= 0) line = trim(line) // ', radiation_length = ' // re_str(material%radiation_length) + endif + endif + ! Cartesian_map. if (associated(ele%cartesian_map)) then diff --git a/bmad/doc/charged-tracking.tex b/bmad/doc/charged-tracking.tex index 7afded5481..da3cbb7e80 100644 --- a/bmad/doc/charged-tracking.tex +++ b/bmad/doc/charged-tracking.tex @@ -763,16 +763,6 @@ \section{Drift Tracking} p_l = \sqrt{1 - \frac{p_x^2 + p_y^2}{(1 + p_z)^2}} \end{equation} -%--------------------------------------------------------------------------------- -%--------------------------------------------------------------------------------- -%\section{FFT Grid Tracking with Space Charge} -%\label{s:egun.sc} -%\index{e_gun} -%\index{space charge} - - - - %--------------------------------------------------------------------------------- %--------------------------------------------------------------------------------- \section{ElSeparator Tracking} @@ -849,7 +839,99 @@ \section{ElSeparator Tracking} %--------------------------------------------------------------------------------- %--------------------------------------------------------------------------------- -\section{Kicker, Hkicker, and Vkicker, Tracking} +\section{Foil Tracking} +\label{s:foil.std} +\index{foil} + +A particle going through a \vn{foil} element is scattered (has an angular change in direction of +propagation), has an energy loss, and the charge of the particle may be affected. The following two +subsections give the formulas used for scattering and energy loss. + +%--------------------------------------------------------------------------------- +\subsection{Scattering in a Foil} +\label{s:foil.scatter} + +For the scattering part of the simulation, the user can select between one of two algorithms, both +of which are given in the paper by Lynch and Dahl\cite{b:lynch}. Both methods scatter using the +equation +\begin{equation} + (dp_x, dp_y) = \frac{p \, \sigma}{P_0} \, (r_1, r_2) + \label{dpr1s} +\end{equation} +where $dp_x$ and $dp_y$ are the change of the $p_x$ and $p_y$ phase space coordinates, $p$ is the +particle momentum, $P_0$ is the reference momentum, $r_1$ and $r_2$ are Gaussian random numbers with +unit sigma and zero mean, and $\sigma$ is the sigma of the angular scattering distribution. The +factor of $p/P_0$ is due to a translation between change in angle and change in phase space momenta +(see \Eq{xpa1p}). The actual scattering distribution has $1/\theta^4$ tails ($\theta$ is the +scattering angle) due to single event large angle scattering (Rutherford scattering). By assuming a +Gaussian disribution, these tails are not simulated. + +The \vn{Highland} algorithm uses Eq~(6) of Lynch and Dahl to calculate the scattering sigma: +\begin{equation} + \sigma = \frac{S_2 \, z}{p \, \beta} \sqrt{\frac{X}{X_0}} \, \left[ + 1 + \epsilon \, \log_{10} \left( \frac{X \, z^2}{X_0 \, \beta^2} \right) \right] + \label{sszpb} +\end{equation} +where the constant $S_2$ has a value of $13.6 \cdot 10^6$~{eV}, $X$ is the foil thickness, $X_0$ is +the material radiation length, $z$ is the particle charge, $\beta$ is the particle relativistic +beta, and $\epsilon$ is a constant with value 0.88. The form of \Eq{sszpb} is slightly different +than Lynch and Dahl Eq~(6) due to the use by \bmad of SI units (except for energy which uses units +of eV). In terms of accuracy, Lynch and Dahl write: +\begin{quote} +This form (Highland equation) takes into account the $p$ and $z$ dependence quite well at small +$Z$, but for large $Z$ and small $X$ the $P$-dependence is not taken into account very well. For +example, for $10^{-3}$ radiation lengths of lead and $p$ = 0.1 (MeV), it overestimates Moliere +scattering angle by 25\% for singly charged particles. +\end{quote} + +The \vn{Lynch_Dahl} algormithm uses Eq~(7) of Lynch and Dahl to calculate the scattering sigma: +\begin{equation} + \sigma = \frac{\chi_c^2}{1 + F^2} \left[ \frac{1 + \nu}{\nu} \ln (1 + \nu) - 1 \right] +\end{equation} +where +\begin{equation} + \nu = \frac{0.5 \, \chi_c^2}{\chi_\alpha^2 (1 - F)} + \label{ncc1f} +\end{equation} +with +\begin{align} + \chi_c^2 &= 0.157 \cdot 10^{11} \, \frac{Z (Z+1) X}{A} \left[ \frac{z}{p \, \beta} \right]^2 \\ + \chi_\alpha &= 2.007 \cdot 10^{-5} \, \frac{Z^{2/3}}{p^2} + \left[1 + 3.34 \cdot 10^6 \, \left( \frac{Z \, z \, \alpha}{\beta} \right)^2 \right] +\end{align} +and $A$ is the atomic weight, $p$ is the particle momentum, $\alpha$ is the fine structure constant, +and $F$ is a fit parameter. +Quoting Lynch and Dahl: +\begin{quote} +Much of the difficulty in approximating multiple Coulomb scattering in terms of the radiation length +(Highland formula) is that the number of radiation lengths is a poor measure of the scattering. We +can get a much better simple expression for the scattering if we do not use the radiation length. An +expression that does much better than the previous ones is (and gives the Lynch-Dahl formula)... + +...This form (Lynch-Dahl), which is not exact, was motivated from a calculation of the RMS angle of the +screened Rutherford cross section ... The constant 0.5 in (Eq.~\ref{ncc1f} above) was determined +empirically. For $F$ anywhere in the range of 90\% to 99.5\% this expression represents Moliere +scattering to better than 2\% +\end{quote} + +%--------------------------------------------------------------------------------- +\subsection{Energy Loss in a Foil} +\label{s:foil.eloss} + +The particle energy loss per unit length $dE/dx$ through a foil is calculated using the \vn{Bethe-Bloch} formula +\begin{equation} + - \left\langle\frac{dE}{dx}\right\rangle = + \frac{4 \pi}{m_e c^2} \cdot \frac{nz^2}{\beta^2} \cdot \left(\frac{e^2}{4\pi\varepsilon_0}\right)^2 \cdot + \left[\ln \left(\frac{2m_e c^2 \beta^2}{I \cdot (1-\beta^2)}\right) - \beta^2\right] + \label{ex4pmc} +\end{equation} +where $n$ is the material electron density, $I$ is the mean excitation energy, $z$ is the particle +charge, $c$ is the speed of light, $\epsilon_0$ is the vacuum permittivity, $\beta = {v}/{c}$, is +the normalized velocity, and $e$ and $m_e$ the electron charge and rest mass respectively. + +%--------------------------------------------------------------------------------- +%--------------------------------------------------------------------------------- +\section{Kicker, Hkicker, and Vkicker Tracking} \label{s:kicker.std} \index{kicker} \index{hkicker} diff --git a/bmad/doc/elements.tex b/bmad/doc/elements.tex index a429c50cde..709ad2711e 100644 --- a/bmad/doc/elements.tex +++ b/bmad/doc/elements.tex @@ -2103,21 +2103,26 @@ \section{Foil} Attributes specific to a \vn{foil} element are: \begin{example} - material_type = ! Foil material. - thickness = ! Material thickness (m). - density = ! Input material density (kg/m^3). - density_used ! Density value used in tracking (kg/m^3). - radiation_length = ! Input material radiation length (m). - radiation_length_used ! Radiation length used in tracking (m). - area_density = ! Input material area density (kg/m^2). - area_density_used ! Area density used in tracking (kg/m^2). - final_charge = ! Final charge state - scatter = ! Is scattering on? Default is True. - x1_edge = ! Foil sheet edge in the +x direction. Default: -99 m. - x2_edge = ! Foil sheet edge in the -x direction. Default: 99 m. - y1_edge = ! Foil sheet edge in the +y direction. Default: -99 m. - y2_edge = ! Foil sheet edge in the -y direction. Default: 99 m. -\end{example} + material_type = ! Foil material. + thickness = ! Material thickness (m). + density = ! Input material density (kg/m^3). + density_used ! Density value used in tracking (kg/m^3). + radiation_length = ! Input material radiation length (m). + radiation_length_used ! Radiation length used in tracking (m). + area_density = ! Input material area density (kg/m^2). + area_density_used ! Area density used in tracking (kg/m^2). + F_factor = ! F scattering factor. Default: 0.95. + final_charge = ! Final charge state + scatter_test = ! For testing scattering. Default: False. + scatter_method = ! Scattering algorithm. Default: highland. + drel_thickness_dx = ! Wedge slope. + x1_edge = ! Foil edge in the +x direction. Default: -99 m. + x2_edge = ! Foil edge in the -x direction. Default: 99 m. + y1_edge = ! Foil edge in the +y direction. Default: -99 m. + y2_edge = ! Foil edge in the -y direction. Default: 99 m. +\end{example} + +The \vn{foil} element has two scattering algorithms. Scattering is simulated to be Gaussian distributed with a sigma given by Eq.~(6) of Lynch and Dahl\cite{b:lynch}. Energy loss is calculated using the Bethe-Bloch formula. @@ -2172,7 +2177,8 @@ \section{Foil} Example: \begin{example} - septum: foil, material_type = "Cu", thickness = 0.127, radiation_length = 12.3, x1_edge = -0.3 + stripper: foil, material_type = "Cu", thickness = 0.127, & + radiation_length = 12.3, x1_edge = -0.3 \end{example} \newpage diff --git a/bmad/doc/wakefields.tex b/bmad/doc/wakefields.tex index d66722f735..7a28b30b07 100644 --- a/bmad/doc/wakefields.tex +++ b/bmad/doc/wakefields.tex @@ -69,14 +69,14 @@ \section{Short--Range Wakes} With either the longitudinal wake $\WlS$ or the transverse $\WtS$ wake, the wake can be approximated as a sum of what are called ``pseudo'' modes $W_i(z)$, $i = 1 \ldots M$: \begin{equation} - W(z) = A_{amp} \, \sum_{i = 1}^M W_i(z) - = A_{amp} \, \sum_{i = 1}^M A_i \, e^{d_i z} \, \sin (k_i \, z + \phi_i) + W(z) = A_a \, \sum_{i = 1}^M W_i(z) + = A_a \, \sum_{i = 1}^M A_i \, e^{d_i z} \, \sin (k_i \, z + \phi_i) \label{wadzk} \end{equation} This is similar to approximating any function as a sum of Fourier terms. The parameters $(A_i, d_i, k_i, \phi_i)$ are chosen by the person constructing the lattice to fit the calculated wake potential. Since $z$ is negative for trailing particles, $d_i$ should be positive to get the wake to -decay exponentially with distance. The dimensionless overall amplitude scale $A_{amp}$ is introduced +decay exponentially with distance. The dimensionless overall amplitude scale $A_a$ is introduced as a convenient way to scale the overall wake. The reason why the pseudo mode approach is used in \bmad is due to the fact that, with pseudo modes, the calculation time scales as the number of particles $N$ while a calculation based upon a table of wake vs $z$ would scale as $N^2$. [The disadvantage is @@ -93,12 +93,12 @@ \section{Long--Range Wakes} Following Chao\cite{b:chao} Eq.~2.88, the long--range wakefields are characterized by a set of cavity modes. The wake function $W_i$ for the $i$\Th mode is \begin{equation} - W_i(t) = -c \, A_{amp} \, \left( \frac{R}{Q} \right)_i \,\, + W_i(t) = -c \, A_a \, \left( \frac{R}{Q} \right)_i \,\, \exp(-d_i \, t) \, \sin (\omega_i \, t + \phi_i) \label{wcrq} \end{equation} The order of the mode $m_i$ does not come into this equation but will appear in equations below. -The dimensionless overall amplitude scale $A_{amp}$ is introduced as a convenient way to scale the +The dimensionless overall amplitude scale $A_a$ is introduced as a convenient way to scale the amplitude of all the wakes with just one parameter. Normally, for a wake that has a well defined mode, The phase factor $\phi_i$ is zero. Finite $\phi_i$ is used for simulations of such things as the long-range resistive wall wake. In this case, the resistive wall wake needs to be modeled as the @@ -166,17 +166,17 @@ \section{Long--Range Wakes} particle passing through at a time $t_w$ with respect to the reference particle will produce wake components \begin{alignat}{2} - \delta a_{\sin} &\equiv &c \, A_{amp} \, \left( \frac{R}{Q} \right) \, + \delta a_{\sin} &\equiv &c \, A_a \, \left( \frac{R}{Q} \right) \, e^{d \, t_w} \, \cos (\omega \, t_w) \, I_m \, \sin(m \theta_w) \CRNO - \delta a_{\cos} &\equiv -&c \, A_{amp} \, \left( \frac{R}{Q} \right) \, + \delta a_{\cos} &\equiv -&c \, A_a \, \left( \frac{R}{Q} \right) \, e^{d \, t_w} \, \sin (\omega \, t_w) \, I_m \, \sin(m \theta_w) \label{ac2rq} \\ - \delta b_{\sin} &\equiv &c \, A_{amp} \, \left( \frac{R}{Q} \right) \, + \delta b_{\sin} &\equiv &c \, A_a \, \left( \frac{R}{Q} \right) \, e^{d \, t_w} \, \cos (\omega \, t_w) \, I_m \, \cos(m \theta_w) \CRNO - \delta b_{\cos} &\equiv -&c \, A_{amp} \, \left( \frac{R}{Q} \right) \, + \delta b_{\cos} &\equiv -&c \, A_a \, \left( \frac{R}{Q} \right) \, e^{d \, t_w} \, \sin (\omega \, t_w) \, I_m \, \cos(m \theta_w) \nonumber \end{alignat} @@ -219,22 +219,22 @@ \section{Long--Range Wakes} $\theta_p$. Equations \eq{akz2q} and \eq{ppcmbar} are unchanged. In place of \Eq{ac2rq}, the contribution of a particle to a mode is \begin{alignat}{2} - \delta a_{\sin} &= & c \, A_{amp} \, \left( \frac{R}{Q} \right) \, + \delta a_{\sin} &= & c \, A_a \, \left( \frac{R}{Q} \right) \, e^{d \, t_w} \, \cos (\omega \, t_w) \, I_m \, \left[ \sin(m \theta_w) \, \sin^2(m \theta_p) + \cos(m \theta_w) \, \sin(m \theta_p) \, \cos(m\theta_p) \right] \CRNO - \delta a_{\cos} &= -& c \, A_{amp} \, \left( \frac{R}{Q} \right) \, + \delta a_{\cos} &= -& c \, A_a \, \left( \frac{R}{Q} \right) \, e^{d \, t_w} \, \sin (\omega \, t_w) \, I_m \, \left[ \sin(m \theta_w) \, \sin^2(m \theta_p) + \cos(m \theta_w) \, \sin(m \theta_p) \, \cos(m\theta_p) \right] \\ - \delta b_{\sin} &= & c \, A_{amp} \, \left( \frac{R}{Q} \right) \, + \delta b_{\sin} &= & c \, A_a \, \left( \frac{R}{Q} \right) \, e^{d \, t_w} \, \cos (\omega \, t_w) \, I_m \, \left[ \cos(m \theta_w) \, \cos^2(m \theta_p) + \sin(m \theta_w) \, \sin(m \theta_p) \, \cos(m\theta_p) \right] \CRNO - \delta b_{\cos} &= -& c \, A_{amp} \, \left( \frac{R}{Q} \right) \, + \delta b_{\cos} &= -& c \, A_a \, \left( \frac{R}{Q} \right) \, e^{d \, t_w} \, \sin (\omega \, t_w) \, I_m \, \left[ \cos(m \theta_w) \, \cos^2(m \theta_p) + \sin(m \theta_w) \, \sin(m \theta_p) \, \cos(m\theta_p) \right] diff --git a/bmad/dummy_routines/xraylib_dummy.f90 b/bmad/dummy_routines/xraylib_dummy.f90 index d20e6f22a1..fee89c1d06 100644 --- a/bmad/dummy_routines/xraylib_dummy.f90 +++ b/bmad/dummy_routines/xraylib_dummy.f90 @@ -7,7 +7,7 @@ ! To use: Compile this file along with any program files. ! ! Note: This module is NOT compiled into the Bmad library. -! Note: This module is obsolete since xraylib is now part of the Bmad Distribution. +! Note: This module is OBSOLETE since xraylib is now part of the Bmad Distribution. !- module xraylib @@ -63,7 +63,7 @@ function atomicweight(n) result (weight) weight = 0 end function -function atomicdensity(n) result (density) +function elementdensity(n) result (density) integer n real(c_double) density density = 0 diff --git a/bmad/low_level/deallocate_ele_pointers.f90 b/bmad/low_level/deallocate_ele_pointers.f90 index ac1ab85bda..4af0f5589c 100644 --- a/bmad/low_level/deallocate_ele_pointers.f90 +++ b/bmad/low_level/deallocate_ele_pointers.f90 @@ -44,6 +44,7 @@ subroutine deallocate_ele_pointers (ele, nullify_only, nullify_branch, dealloc_p nullify (ele%ac_kick) nullify (ele%control) nullify (ele%converter) + nullify (ele%foil) nullify (ele%cartesian_map) nullify (ele%cylindrical_map) nullify (ele%gen_grad_map) @@ -77,6 +78,7 @@ subroutine deallocate_ele_pointers (ele, nullify_only, nullify_branch, dealloc_p if (associated (ele%descrip)) deallocate (ele%descrip) if (associated (ele%control)) deallocate (ele%control) if (associated (ele%converter)) deallocate (ele%converter) +if (associated (ele%foil)) deallocate (ele%foil) if (associated (ele%rad_map)) deallocate (ele%rad_map) if (associated (ele%r)) deallocate (ele%r) if (associated (ele%custom)) deallocate (ele%custom) diff --git a/bmad/low_level/track_a_foil.f90 b/bmad/low_level/track_a_foil.f90 index 18403ca290..da07b9c000 100644 --- a/bmad/low_level/track_a_foil.f90 +++ b/bmad/low_level/track_a_foil.f90 @@ -30,13 +30,15 @@ subroutine track_a_foil (orbit, ele, param, mat6, make_matrix) type (coord_struct) :: orbit, orb0 type (ele_struct), target :: ele type (lat_param_struct) :: param +type (material_struct), pointer :: material real(rp), optional :: mat6(6,6) real(rp) xx0, sigma, rnd(2), I_excite, mass_material, dE_dx_tot, E0, E1, p2, elec_area_density -real(rp) pc_old, pc_new +real(rp) pc_old, pc_new, r_thick, chi2_c, chi2_alpha, nu, f +real(rp) atomic_mass real(rp), parameter :: S2 = 13.6e6_dp, epsilon = 0.088 ! Factor of 1e6 is due to original formula using MeV/c for momentum -integer i, n, material, z_material, z_part, n_step +integer i, j, ns, n_step, z_material, z_particle logical, optional :: make_matrix @@ -44,36 +46,78 @@ subroutine track_a_foil (orbit, ele, param, mat6, make_matrix) ! On target? If not, there is nothing to be done. +call offset_particle (ele, set$, orbit, set_hvkicks = .false., mat6 = mat6, make_matrix = make_matrix) + if (orbit%vec(1) < ele%value(x1_edge$) .or. orbit%vec(1) > ele%value(x2_edge$)) return if (orbit%vec(3) < ele%value(y1_edge$) .or. orbit%vec(3) > ele%value(y2_edge$)) return -! Angle scatter - -material = species_id(ele%component_name) -z_material = atomic_number(material) -z_part = atomic_number(orbit%species) - -if (is_true(ele%value(scatter$))) then - call ran_gauss(rnd) - xx0 = ele%value(area_density_used$) / ele%value(radiation_length_used$) - sigma = S2 * z_part * sqrt(xx0) / (orbit%p0c * orbit%beta) * (1.0_rp + epsilon * log10(xx0*z_part**2/orbit%beta**2)) - - orbit%vec(2) = orbit%vec(2) + rnd(1) * sigma - orbit%vec(4) = orbit%vec(4) + rnd(2) * sigma -endif - -! Energy loss +r_thick = 1.0_rp + ele%value(drel_thickness_dx$) * orbit%vec(1) +z_particle = nint(ele%value(final_charge$)) -I_excite = mean_excitation_energy_over_z(z_material) * z_material -mass_material = mass_of(material) / atomic_mass_unit -elec_area_density = (1.0e3_rp * N_avogadro) * ele%value(area_density_used$) * z_material / mass_material ! number_electrons / m^2 +! n_step = nint(ele%value(num_steps$)) -do i = 1, n_step +do ns = 1, n_step pc_old = orbit%p0c * (1.0_rp + orbit%vec(6)) + + ! Angle scatter + + if (nint(ele%value(scatter_method$)) /= off$) then + xx0 = 0 + do i = 1, size(ele%foil%material) + material => ele%foil%material(i) + z_material = atomic_number(material%species) + select case (nint(ele%value(scatter_method$))) + case (highland$) + ! Lynch-Dahl Eq 10 is used to sum over all components + xx0 = xx0 + r_thick * material%area_density_used / material%radiation_length_used + + case (lynch_dahl$) + f = ele%value(f_factor$) + atomic_mass = mass_of(material%species) / atomic_mass_unit + chi2_c = 0.157_rp * (z_material * (z_material + 1) * r_thick * material%area_density_used / atomic_mass) * & + (z_particle / (pc_old * orbit%beta))**2 + chi2_alpha = 2.007e-5_rp * z_material**(2.0/3.0) * & + (1.0_rp + 3.34 * (z_material * z_particle * fine_structure_constant / orbit%beta)**2) / pc_old**2 + nu = 0.5_rp * chi2_c / (chi2_alpha * (1 + f)) + sigma = chi2_c * ((1 + nu) * log(1 + nu) / nu - 1) / (1 + f**2) + end select + enddo + + if (is_true(ele%value(scatter_test$))) then + rnd = 1 + else + call ran_gauss(rnd) + endif + + select case (nint(ele%value(scatter_method$))) + case (highland$) + sigma = S2 * z_particle * sqrt(xx0) / (pc_old * orbit%beta) * & + (1.0_rp + epsilon * log10(xx0*z_particle**2/orbit%beta**2)) + case (lynch_dahl$) + end select + + sigma = sigma * pc_old / orbit%p0c + orbit%vec(2) = orbit%vec(2) + rnd(1) * sigma + orbit%vec(4) = orbit%vec(4) + rnd(2) * sigma + endif + + ! Energy loss + p2 = (pc_old / mass_of(orbit%species))**2 ! beta^2 / (1 - beta^2) term - dE_dx_tot = -fourpi * mass_of(electron$) * elec_area_density * (z_part * r_e / orbit%beta)**2 * & + + dE_dx_tot = 0 + do j = 1, size(ele%foil%material) + material = ele%foil%material(j) + z_material = atomic_number(material%species) + I_excite = mean_excitation_energy_over_z(z_material) * z_material + mass_material = mass_of(material%species) / atomic_mass_unit + ! number_electrons / m^2 + elec_area_density = (1.0e3_rp * N_avogadro) * r_thick * material%area_density_used * z_material / mass_material + dE_dx_tot = dE_dx_tot - fourpi * mass_of(electron$) * elec_area_density * (z_particle * r_e / orbit%beta)**2 * & (log(2 * mass_of(electron$) * p2 / I_excite) - orbit%beta**2) + enddo + E0 = orbit%p0c * (1.0_rp + orbit%vec(6)) / orbit%beta E1 = E0 + dE_dx_tot / n_step call convert_total_energy_to(E1, orbit%species, beta = orbit%beta, pc = pc_new) @@ -84,13 +128,10 @@ subroutine track_a_foil (orbit, ele, param, mat6, make_matrix) ! Charge -n = nint(ele%value(final_charge$)) -orbit%species = set_species_charge(orbit%species, n) +orbit%species = set_species_charge(orbit%species, z_particle) ! -if (logic_option(.false., make_matrix)) then - call mat_make_unit(mat6) -endif +call offset_particle (ele, unset$, orbit, set_hvkicks = .false., mat6 = mat6, make_matrix = make_matrix) end subroutine track_a_foil diff --git a/bmad/modules/attribute_mod.f90 b/bmad/modules/attribute_mod.f90 index 86df5ed882..30c5c534c4 100644 --- a/bmad/modules/attribute_mod.f90 +++ b/bmad/modules/attribute_mod.f90 @@ -937,7 +937,8 @@ subroutine init_attribute_name_array () call init_attribute_name1 (converter$, angle_out_max$, 'ANGLE_OUT_MAX') call init_attribute_name1 (converter$, species_out$, 'SPECIES_OUT') -call init_attribute_name1 (foil$, scatter$, 'SCATTER') +call init_attribute_name1 (foil$, scatter_method$, 'SCATTER_METHOD') +call init_attribute_name1 (foil$, scatter_test$, 'SCATTER_TEST') call init_attribute_name1 (foil$, thickness$, 'THICKNESS') call init_attribute_name1 (foil$, material_type$, 'MATERIAL_TYPE') call init_attribute_name1 (foil$, final_charge$, 'FINAL_CHARGE') @@ -951,6 +952,10 @@ subroutine init_attribute_name_array () call init_attribute_name1 (foil$, x2_edge$, 'X2_EDGE') call init_attribute_name1 (foil$, y1_edge$, 'Y1_EDGE') call init_attribute_name1 (foil$, y2_edge$, 'Y2_EDGE') +call init_attribute_name1 (foil$, drel_thickness_dx$, 'DREL_THICKNESS_DX') +call init_attribute_name1 (foil$, atomic_weight$, 'ATOMIC_WEIGHT') +call init_attribute_name1 (foil$, f_factor$, 'F_FACTOR') +call init_attribute_name1 (foil$, num_steps$, 'NUM_STEPS') !! call init_attribute_name1 (foil$, probability_final_charge$ 'PROBABILITY_FINAL_CHARGE') @@ -1904,10 +1909,10 @@ function attribute_type (attrib_name, ele) result (attrib_type) 'TAYLOR_MAP_INCLUDES_OFFSETS', 'OFFSET_MOVES_APERTURE', 'FIELD_MASTER', 'SCALE_MULTIPOLES', & 'FLEXIBLE', 'NEW_BRANCH', 'SPIN_FRINGE_ON', 'REF_TIME_OFFSET', 'WRAP_SUPERIMPOSE', & 'BRANCHES_ARE_COHERENT', 'E_CENTER_RELATIVE_TO_REF', 'SCALE_FIELD_TO_ONE', & - 'MULTIPOLES_ON', 'LR_SELF_WAKE_ON', 'GEO', 'SCATTER', & + 'MULTIPOLES_ON', 'LR_SELF_WAKE_ON', 'GEO', 'SCATTER', 'SCATTER_TEST', & 'CONSTANT_REF_ENERGY', 'CREATE_JUMBO_SLAVE', 'PTC_CANONICAL_COORDS', 'LR_WAKE%SELF_WAKE_ON', & 'SR_WAKE%SCALE_WITH_LENGTH', 'IS_MOSAIC', 'INHERIT_FROM_FORK', 'MODE_FLIP', & - 'EXACT_MODEL', 'EXACT_MISALIGN', 'OLD_INTEGRATOR', & + 'EXACT_MODEL', 'EXACT_MISALIGN', 'OLD_INTEGRATOR', 'RECALC', & 'MODE_FLIP0', 'MODE_FLIP1', 'STATIC_LINEAR_MAP', 'USER_SETS_LENGTH', 'USE_REFLECTIVITY_TABLE') attrib_type = is_logical$ @@ -1924,7 +1929,8 @@ function attribute_type (attrib_name, ele) result (attrib_type) 'TRACKING_METHOD', 'REF_ORBIT_FOLLOWS', 'REF_COORDS', 'MODE', 'CAVITY_TYPE', 'FIELD_TYPE', & 'SPATIAL_DISTRIBUTION', 'ENERGY_DISTRIBUTION', 'VELOCITY_DISTRIBUTION', 'KEY', 'SLAVE_STATUS', & 'LORD_STATUS', 'PHOTON_TYPE', 'ELE_ORIGIN', 'REF_ORIGIN', 'CSR_METHOD', 'SPACE_CHARGE_METHOD', & - 'MULTIPASS_REF_ENERGY', 'REF_SPECIES', 'SPECIES_OUT', 'DISTRIBUTION', 'LATTICE_TYPE', 'SPECIES_STRONG') + 'MULTIPASS_REF_ENERGY', 'REF_SPECIES', 'SPECIES_OUT', 'DISTRIBUTION', 'LATTICE_TYPE', 'SPECIES_STRONG', & + 'SCATTER_METHOD') attrib_type = is_switch$ case ('TYPE', 'ALIAS', 'DESCRIP', 'SR_WAKE_FILE', 'LR_WAKE_FILE', 'LATTICE', 'PHYSICAL_SOURCE', & @@ -2458,6 +2464,10 @@ function switch_attrib_value_name (attrib_name, attrib_value, ele, is_default, n call get_this_attrib_name (attrib_val_name, ix_attrib_val, ref_orbit_follows_name, lbound(ref_orbit_follows_name, 1)) if (present(is_default)) is_default = (ix_attrib_val == bragg_diffracted$) +case ('SCATTER_METHOD') + call get_this_attrib_name (attrib_val_name, ix_attrib_val, scatter_method_name, lbound(scatter_method_name, 1)) + if (present(is_default)) is_default = (ix_attrib_val == bragg_diffracted$) + case ('SECTION^TYPE') ! This is for the Tao "python" command call get_this_attrib_name (attrib_val_name, ix_attrib_val, wall3d_section_type_name, lbound(wall3d_section_type_name, 1)) if (present(is_default)) is_default = .false. diff --git a/bmad/modules/bmad_struct.f90 b/bmad/modules/bmad_struct.f90 index 2267278526..57cbfb38d2 100644 --- a/bmad/modules/bmad_struct.f90 +++ b/bmad/modules/bmad_struct.f90 @@ -18,7 +18,7 @@ module bmad_struct ! IF YOU CHANGE THE LAT_STRUCT OR ANY ASSOCIATED STRUCTURES YOU MUST INCREASE THE VERSION NUMBER !!! ! THIS IS USED BY BMAD_PARSER TO MAKE SURE DIGESTED FILES ARE OK. -integer, parameter :: bmad_inc_version$ = 309 +integer, parameter :: bmad_inc_version$ = 310 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -186,6 +186,9 @@ module bmad_struct integer, parameter :: user_set$ = 0, first_pass$ = 1 character(12), parameter :: multipass_ref_energy_name(0:1) = [character(12):: 'User_Set', 'First_Pass'] +integer, parameter :: highland$ = 2, lynch_dahl$ = 3 +character(12), parameter :: scatter_method_name(3) = [character(12):: 'Off', 'Highland', 'Lynch_Dahl'] + !------------------------------------------------------------------------- ! Structure for holding the photon reflection probability tables. ! Used for both smooth surface reflections and custom crystal reflections. @@ -1234,6 +1237,19 @@ module bmad_struct type (converter_direction_out_struct) :: dir_out end type +! Foil structure + +type material_struct + integer :: species = not_set$ + real(rp) :: density = 0, density_used = 0 + real(rp) :: area_density = 0, area_density_used = 0 + real(rp) :: radiation_length = 0, radiation_length_used = 0 +end type + +type foil_struct + type (material_struct), allocatable :: material(:) +end type + ! Distribution of outgoing particles for a given thickness. type converter_distribution_struct @@ -1325,6 +1341,7 @@ module bmad_struct type (branch_struct), pointer :: branch => null() ! Pointer to branch containing element. type (controller_struct), pointer :: control => null() ! group & overlay variables. type (converter_struct), pointer :: converter => null() ! EG: Positron converter in linac. + type (foil_struct), pointer :: foil => null() type (ele_struct), pointer :: lord => null() ! Pointer to a slice lord. type (fibre), pointer :: ptc_fibre => null() ! PTC track corresponding to this ele. type (floor_position_struct) :: floor = floor_position_struct(vec3_zero$, mat3_unit$, 0.0_rp, 0.0_rp, 0.0_rp) @@ -1655,21 +1672,19 @@ module bmad_struct integer, parameter :: l$ = 1 ! Assumed unique. Do not assign 1 to another attribute. integer, parameter :: tilt$ = 2, roll$ = 2, n_part$ = 2, inherit_from_fork$ = 2 ! Important: tilt$ = roll$ -integer, parameter :: ref_tilt$ = 3, direction$ = 3, repetition_frequency$ = 3 -integer, parameter :: kick$ = 3, x_gain_err$ = 3, taylor_order$ = 3, r_solenoid$ = 3, final_charge$ = 3 -integer, parameter :: k1$ = 4, kx$ = 4, harmon$ = 4, h_displace$ = 4, y_gain_err$ = 4 -integer, parameter :: critical_angle_factor$ = 4, tilt_corr$ = 4, ref_coords$ = 4, dt_max$ = 4, radiation_length$ = 4 -integer, parameter :: graze_angle$ = 5, k2$ = 5, b_max$ = 5, v_displace$ = 5, gradient_tot$ = 5, harmon_master$ = 5 -integer, parameter :: ks$ = 5, flexible$ = 5, crunch$ = 5, ref_orbit_follows$ = 5, pc_out_min$ = 5 -integer, parameter :: radiation_length_used$ = 5 -integer, parameter :: gradient$ = 6, k3$ = 6, noise$ = 6, new_branch$ = 6, ix_branch$ = 6, g_max$ = 6 -integer, parameter :: g$ = 6, symmetry$ = 6, field_scale_factor$ = 6, pc_out_max$ = 6, density$ = 6 -integer, parameter :: dg$ = 7, bbi_const$ = 7, osc_amplitude$ = 7, ix_to_branch$ = 7, angle_out_max$ = 7 -integer, parameter :: gradient_err$ = 7, critical_angle$ = 7, bragg_angle_in$ = 7, spin_dn_dpz_x$ = 7, density_used$ = 7 -integer, parameter :: delta_e_ref$ = 8, interpolation$ = 8, bragg_angle_out$ = 8, k1x$ = 8, spin_dn_dpz_y$ = 8 -integer, parameter :: charge$ = 8, x_gain_calib$ = 8, ix_to_element$ = 8, voltage$ = 8, g_tot$ = 8, area_density$ = 8 +integer, parameter :: ref_tilt$ = 3, direction$ = 3, repetition_frequency$ = 3, & + kick$ = 3, x_gain_err$ = 3, taylor_order$ = 3, r_solenoid$ = 3, final_charge$ = 3 +integer, parameter :: k1$ = 4, kx$ = 4, harmon$ = 4, h_displace$ = 4, y_gain_err$ = 4, & + critical_angle_factor$ = 4, tilt_corr$ = 4, ref_coords$ = 4, dt_max$ = 4 +integer, parameter :: graze_angle$ = 5, k2$ = 5, b_max$ = 5, v_displace$ = 5, gradient_tot$ = 5, harmon_master$ = 5, & + ks$ = 5, flexible$ = 5, crunch$ = 5, ref_orbit_follows$ = 5, pc_out_min$ = 5 +integer, parameter :: gradient$ = 6, k3$ = 6, noise$ = 6, new_branch$ = 6, ix_branch$ = 6, g_max$ = 6, & + g$ = 6, symmetry$ = 6, field_scale_factor$ = 6, pc_out_max$ = 6 +integer, parameter :: dg$ = 7, bbi_const$ = 7, osc_amplitude$ = 7, ix_to_branch$ = 7, angle_out_max$ = 7, & + gradient_err$ = 7, critical_angle$ = 7, bragg_angle_in$ = 7, spin_dn_dpz_x$ = 7 +integer, parameter :: delta_e_ref$ = 8, interpolation$ = 8, bragg_angle_out$ = 8, k1x$ = 8, spin_dn_dpz_y$ = 8, & + charge$ = 8, x_gain_calib$ = 8, ix_to_element$ = 8, voltage$ = 8, g_tot$ = 8 integer, parameter :: rho$ = 9, voltage_err$ = 9, bragg_angle$ = 9, k1y$ = 9, n_particle$ = 9, spin_dn_dpz_z$ = 9 -integer, parameter :: area_density_used$ = 9 integer, parameter :: fringe_type$ = 10, dbragg_angle_de$ = 10 integer, parameter :: fringe_at$ = 11, gang$ = 11, darwin_width_sigma$ = 11 integer, parameter :: darwin_width_pi$ = 12 @@ -1681,35 +1696,40 @@ module bmad_struct ! longitudinal_mode$ is near to rf_wavelength$ for type_ele to print rf_bucket_length near rf_wavelength$ integer, parameter :: sig_vy$ = 18, constant_ref_energy$ = 18, longitudinal_mode$ = 18 integer, parameter :: sig_e$ = 19, sig_pz$ = 19, autoscale_amplitude$ = 19 -integer, parameter :: d1_thickness$ = 20, default_tracking_species$ = 20, autoscale_phase$ = 20 -integer, parameter :: n_slice$ = 20, y_gain_calib$ = 20, sig_e2$ = 20 -integer, parameter :: fb1$ = 21, polarity$ = 21, crunch_calib$ = 21, alpha_angle$ = 21, d2_thickness$ = 21 -integer, parameter :: beta_a_strong$ = 21, beta_a_out$ = 21, e_loss$ = 21, gap$ = 21, spin_x$ = 21 -integer, parameter :: E_center$ = 21, scatter$ = 21 -integer, parameter :: fb2$ = 22, x_offset_calib$ = 22, v1_unitcell$ = 22, psi_angle$ = 22, cavity_type$ = 22 -integer, parameter :: beta_b_strong$ = 22, beta_b_out$ = 22, spin_y$ = 22, E2_center$ = 22, n_period$ = 22 -integer, parameter :: emit_fraction$ = 22, x1_edge$ = 22 -integer, parameter :: y_offset_calib$ = 23, v_unitcell$ = 23, v2_unitcell$ = 23, spin_z$ = 23, l_period$ = 23 -integer, parameter :: fq1$ = 23, alpha_a_strong$ = 23, alpha_a_out$ = 23, E2_probability$ = 23, phi0_max$ = 23 -integer, parameter :: x2_edge$ = 23 -integer, parameter :: fq2$ = 24, phi0$ = 24, tilt_calib$ = 24, E_center_relative_to_ref$ = 24, y1_edge$ = 24 -integer, parameter :: alpha_b_strong$ = 24, alpha_b_out$ = 24, is_mosaic$ = 24, px_aperture_width2$ = 24 -integer, parameter :: phi0_err$ = 25, current$ = 25, mosaic_thickness$ = 25, px_aperture_center$ = 25, y2_edge$ = 25 -integer, parameter :: eta_x_out$ = 25, quad_tilt$ = 25, de_eta_meas$ = 25, spatial_distribution$ = 25, species_strong$ = 25 -integer, parameter :: eta_y_out$ = 26, bend_tilt$ = 26, mode$ = 26, velocity_distribution$ = 26, py_aperture_width2$ = 26 -integer, parameter :: phi0_multipass$ = 26, n_sample$ = 26, origin_ele_ref_pt$ = 26, mosaic_angle_rms_in_plane$ = 26 -integer, parameter :: eps_step_scale$ = 26, E_tot_strong$ = 26 -integer, parameter :: etap_x_out$ = 27, phi0_autoscale$ = 27, dx_origin$ = 27, energy_distribution$ = 27 -integer, parameter :: x_quad$ = 27, ds_photon_slice$ = 27, mosaic_angle_rms_out_plane$ = 27 -integer, parameter :: py_aperture_center$ = 27, x_dispersion_err$ = 27 -integer, parameter :: etap_y_out$ = 28, dy_origin$ = 28, y_quad$ = 28, e_field_x$ = 28, b_field_tot$ = 28 -integer, parameter :: y_dispersion_err$ = 28, z_aperture_width2$ = 28, user_sets_length$ = 28, rf_clock_harmonic$ = 28 -integer, parameter :: upstream_coord_dir$ = 29, dz_origin$ = 29, mosaic_diffraction_num$ = 29, z_aperture_center$ = 29 -integer, parameter :: cmat_11$ = 29, field_autoscale$ = 29, l_sagitta$ = 29, e_field_y$ = 29, x_dispersion_calib$ = 29 -integer, parameter :: cmat_12$ = 30, dtheta_origin$ = 30, b_param$ = 30, l_chord$ = 30, scale_field_to_one$ = 30 -integer, parameter :: downstream_coord_dir$ = 30, pz_aperture_width2$ = 30, y_dispersion_calib$ = 30, voltage_tot$ = 30 -integer, parameter :: cmat_21$ = 31, l_active$ = 31, dphi_origin$ = 31, split_id$ = 31, ref_cap_gamma$ = 31 -integer, parameter :: l_soft_edge$ = 31, transverse_sigma_cut$ = 31, pz_aperture_center$ = 31 +integer, parameter :: d1_thickness$ = 20, default_tracking_species$ = 20, autoscale_phase$ = 20, & + n_slice$ = 20, y_gain_calib$ = 20, sig_e2$ = 20 +integer, parameter :: fb1$ = 21, polarity$ = 21, crunch_calib$ = 21, alpha_angle$ = 21, d2_thickness$ = 21, & + beta_a_strong$ = 21, beta_a_out$ = 21, e_loss$ = 21, gap$ = 21, spin_x$ = 21, & + E_center$ = 21, scatter_test$ = 21 +integer, parameter :: fb2$ = 22, x_offset_calib$ = 22, v1_unitcell$ = 22, psi_angle$ = 22, cavity_type$ = 22, & + beta_b_strong$ = 22, beta_b_out$ = 22, spin_y$ = 22, E2_center$ = 22, n_period$ = 22, & + emit_fraction$ = 22, x1_edge$ = 22 +integer, parameter :: y_offset_calib$ = 23, v_unitcell$ = 23, v2_unitcell$ = 23, spin_z$ = 23, l_period$ = 23, & + fq1$ = 23, alpha_a_strong$ = 23, alpha_a_out$ = 23, E2_probability$ = 23, phi0_max$ = 23, & + x2_edge$ = 23 +integer, parameter :: fq2$ = 24, phi0$ = 24, tilt_calib$ = 24, E_center_relative_to_ref$ = 24, y1_edge$ = 24, & + alpha_b_strong$ = 24, alpha_b_out$ = 24, is_mosaic$ = 24, px_aperture_width2$ = 24 +integer, parameter :: phi0_err$ = 25, current$ = 25, mosaic_thickness$ = 25, px_aperture_center$ = 25, & + eta_x_out$ = 25, quad_tilt$ = 25, de_eta_meas$ = 25, spatial_distribution$ = 25, & + y2_edge$ = 25, species_strong$ = 25 +integer, parameter :: eta_y_out$ = 26, mode$ = 26, velocity_distribution$ = 26, py_aperture_width2$ = 26, & + phi0_multipass$ = 26, n_sample$ = 26, origin_ele_ref_pt$ = 26, mosaic_angle_rms_in_plane$ = 26, & + eps_step_scale$ = 26, E_tot_strong$ = 26, drel_thickness_dx$ = 26, bend_tilt$ = 26 +integer, parameter :: etap_x_out$ = 27, phi0_autoscale$ = 27, dx_origin$ = 27, energy_distribution$ = 27, & + x_quad$ = 27, ds_photon_slice$ = 27, mosaic_angle_rms_out_plane$ = 27, & + py_aperture_center$ = 27, x_dispersion_err$ = 27 +integer, parameter :: etap_y_out$ = 28, dy_origin$ = 28, y_quad$ = 28, e_field_x$ = 28, & + y_dispersion_err$ = 28, z_aperture_width2$ = 28, user_sets_length$ = 28, & + rf_clock_harmonic$ = 28, b_field_tot$ = 28, atomic_weight$ = 28 +integer, parameter :: upstream_coord_dir$ = 29, dz_origin$ = 29, mosaic_diffraction_num$ = 29, & + cmat_11$ = 29, field_autoscale$ = 29, l_sagitta$ = 29, e_field_y$ = 29, & + x_dispersion_calib$ = 29, z_aperture_center$ = 29, f_factor$ = 29 +integer, parameter :: cmat_12$ = 30, dtheta_origin$ = 30, b_param$ = 30, l_chord$ = 30, & + downstream_coord_dir$ = 30, pz_aperture_width2$ = 30, y_dispersion_calib$ = 30, & + scale_field_to_one$ = 30, voltage_tot$ = 30, scatter_method$ = 30 +integer, parameter :: cmat_21$ = 31, l_active$ = 31, dphi_origin$ = 31, split_id$ = 31, ref_cap_gamma$ = 31, & + l_soft_edge$ = 31, transverse_sigma_cut$ = 31, pz_aperture_center$ = 31, & + mean_excitation_energy$ = 31 integer, parameter :: cmat_22$ = 32, dpsi_origin$ = 32, t_offset$ = 32, ds_slice$ = 32, use_reflectivity_table$ = 32 integer, parameter :: angle$ = 33, n_cell$ = 33, mode_flip$ = 33, z_crossing$ = 33, x_kick$ = 33 integer, parameter :: x_pitch$ = 34, px_kick$ = 34 ! Note: [x_kick$, px_kick$, ..., pz_kick$] must be in order. @@ -1761,13 +1781,17 @@ module bmad_struct integer, parameter :: tt$ = 81, x_knot$ = 81 integer, parameter :: alias$ = 82, max_fringe_order$ = 82, eta_x$ = 82 integer, parameter :: electric_dipole_moment$ = 83, lr_self_wake_on$ = 83, x_ref$ = 83, species_out$ = 83 -integer, parameter :: y_knot$ = 83, eta_y$ = 83 -integer, parameter :: lr_wake_file$ = 84, px_ref$ = 84, elliptical_curvature_x$ = 84, etap_x$ = 84, slave$ = 84 -integer, parameter :: lr_freq_spread$ = 85, y_ref$ = 85, elliptical_curvature_y$ = 85, etap_y$ = 85 -integer, parameter :: lattice$ = 86, phi_a$ = 86, multipoles_on$ = 86, py_ref$ = 86, elliptical_curvature_z$ = 86 +integer, parameter :: y_knot$ = 83, eta_y$ = 83, density$ = 83 +integer, parameter :: lr_wake_file$ = 84, px_ref$ = 84, elliptical_curvature_x$ = 84, etap_x$ = 84, slave$ = 84, & + density_used$ = 84 +integer, parameter :: lr_freq_spread$ = 85, y_ref$ = 85, elliptical_curvature_y$ = 85, etap_y$ = 85, & + area_density$ = 85 +integer, parameter :: lattice$ = 86, phi_a$ = 86, multipoles_on$ = 86, py_ref$ = 86, elliptical_curvature_z$ = 86, & + area_density_used$ = 86 integer, parameter :: aperture_type$ = 87, eta_z$ = 87, machine$ = 87 -integer, parameter :: taylor_map_includes_offsets$ = 88, pixel$ = 88, p88$ = 88 -integer, parameter :: csr_method$ = 89, var$ = 89, z_ref$ = 89, p89$ = 89 +integer, parameter :: taylor_map_includes_offsets$ = 88, pixel$ = 88, p88$ = 88, radiation_length$ = 88 +integer, parameter :: csr_method$ = 89, var$ = 89, z_ref$ = 89, p89$ = 89, radiation_length_used$ = 89 + integer, parameter :: pz_ref$ = 90, space_charge_method$ = 90, p90$ = 90 integer, parameter :: mat6_calc_method$ = 91 integer, parameter :: tracking_method$ = 92, s_long$ = 92 diff --git a/bmad/modules/equal_mod.f90 b/bmad/modules/equal_mod.f90 index 65479f90b5..b98c47c9c4 100644 --- a/bmad/modules/equal_mod.f90 +++ b/bmad/modules/equal_mod.f90 @@ -344,6 +344,26 @@ subroutine ele_equals_ele (ele_out, ele_in, update_nametable) if (associated (ele_save%converter)) deallocate(ele_save%converter) endif +! %foil + +if (associated(ele_in%foil)) then + n = size(ele_in%foil%material) + ele_out%foil => ele_save%foil ! reinstate + if (associated(ele_out%foil)) then + comensurate = .false. + if (size(ele_out%foil%material) /= n) deallocate(ele_out%foil) + endif + + if (.not. associated(ele_out%foil)) then + allocate(ele_out%foil) + allocate(ele_out%foil%material(n)) + endif + ele_out%foil = ele_in%foil + +else + if (associated (ele_save%foil)) deallocate(ele_save%foil) +endif + ! %taylor do i = 1, 6 diff --git a/bmad/parsing/bmad_parser_mod.f90 b/bmad/parsing/bmad_parser_mod.f90 index da438f460f..570745f592 100644 --- a/bmad/parsing/bmad_parser_mod.f90 +++ b/bmad/parsing/bmad_parser_mod.f90 @@ -86,7 +86,7 @@ subroutine parser_set_attribute (how, ele, delim, delim_found, err_flag, pele, c type (photon_reflect_table_struct), pointer :: rt real(rp) kx, ky, kz, tol, value, coef, r_vec(10), r0(2), vec(1000) -real(rp), allocatable :: table(:,:) +real(rp), allocatable :: table(:,:), arr(:) real(rp), pointer :: r_ptr integer i, i2, j, k, n, na, ne, nn, nt, ix_word, how, ix_word1, ix_word2, ios, ix, iy, i_out, ix_coef, switch @@ -1815,6 +1815,25 @@ subroutine parser_set_attribute (how, ele, delim, delim_found, err_flag, pele, c select case (attrib_word) +case ('DENSITY', 'AREA_DENSITY', 'RADIATION_LENGTH') + ok = parse_real_list2(lat, 'READING: ' // trim(attrib_word) // ' FOR ELEMENT: ' // ele%name, & + arr, n, delim, delim_found, 10, '(', ',', ')', 0.0_rp) + if (.not. ok) return + if (allocated(ele%foil%material)) then + if (size(ele%foil%material) /= n) then + call parser_error('MATERIAL_TYPE, DENSITY, AREA_DENSITY, AND RADIATION_LENGTH MUST ALL BE THE SAME SIZE VECTORS FOR ELE: ' // ele%name) + return + endif + else + allocate(ele%foil%material(n)) + endif + + select case (attrib_word) + case ('DENSITY'); ele%foil%material(:)%density = arr + case ('AREA_DENSITY'); ele%foil%material(:)%area_density = arr + case ('RADIATION_LENGTH'); ele%foil%material(:)%radiation_length = arr + end select + case ('REFERENCE') if (.not. present(pele)) call parser_error ('INTERNAL ERROR...') call get_next_word(pele%ref_name, ix_word, '=,', delim, delim_found, .true.) @@ -2061,6 +2080,10 @@ subroutine parser_set_attribute (how, ele, delim, delim_found, err_flag, pele, c case ('SCALE_MULTIPOLES') call parser_get_logical (attrib_word, ele%scale_multipoles, ele%name, delim, delim_found, err_flag); if (err_flag) return +case ('SCATTER_METHOD') + call get_switch (attrib_word, scatter_method_name(1:), ix, err_flag, ele, delim, delim_found); if (err_flag) return + ele%value(scatter_method$) = ix + case ('SPATIAL_DISTRIBUTION') call get_switch (attrib_word, distribution_name(1:), ix, err_flag, ele, delim, delim_found); if (err_flag) return ele%value(spatial_distribution$) = ix @@ -9499,10 +9522,10 @@ end function parse_real_lists !------------------------------------------------------------------------- !+ ! Function parse_real_list2 (lat, err_str, real_array, num_found, delim, delim_found, num_expected, -! open_delim, separator, close_delim, default_value) result (is_ok) +! open_delim, separator, close_delim, default_value, brace_optional) result (is_ok) ! ! Routine to parse a list of reals of the form: -! open_delim real_1 separator real_2 . . . close_delim +! open_brace real_1 separator real_2 . . . close_brace ! Example: "(1.2, 2.3, 4.4, 8.5)" ! ! Also see: @@ -9514,24 +9537,25 @@ end function parse_real_lists ! err_str -- character(*): Error string to print if there is an error. ! real_array -- real(rp), allocatable: the array to be read in ! -! Optional: +! Optional: ! num_expected = 10 -- integer, optional: number of expected arguments ! Used to initialize real_array -! open_delim = '(' -- character(1), optional: opening delimeter +! open_brace = '(' -- character(1), optional: opening delimeter. ! separator = ',' -- character(1), optional: separating character -! close_delim = ')' -- character(1), optional: closing delimeter -! default_value = 0.0_rp -- real(rp) : inital assignment of real_array elements +! close_brace = ')' -- character(1), optional: closing delimeter +! default_value = 0.0_rp -- real(rp), optional: inital assignment of real_array elements. +! brace_optional = False -- logical, optional: If true then an array with a single value and no braces is accepted. ! ! Output: ! is_ok -- logical: Set True if everything is ok ! real_array(1:num_found) -- real(rp) : Array of values ! num_found -- integer : number of elements ! delim -- character(1): Delimiter found where the parsing of the input line stops. -! delim_found -- logical: Delimiter found? False if end of input command. +! delim_found -- logical: Stopping delimiter found? False if end of input command. !- function parse_real_list2 (lat, err_str, real_array, num_found, delim, delim_found, num_expected, & - open_delim, separator, close_delim, default_value) result (is_ok) + open_brace, separator, close_brace, default_value, brace_optional) result (is_ok) ! Arguments @@ -9546,7 +9570,7 @@ function parse_real_list2 (lat, err_str, real_array, num_found, delim, delim_fou logical is_ok character(*) err_str -character(*), optional :: open_delim, close_delim, separator +character(*), optional :: open_brace, close_brace, separator ! Local @@ -9555,10 +9579,11 @@ function parse_real_list2 (lat, err_str, real_array, num_found, delim, delim_fou integer num_expect integer ix_word -character(1) delim, op_delim, cl_delim, sep +character(1) delim, op_brace, cl_brace, sep character(40) :: word logical delim_found, err_flag +logical, optional :: brace_optional ! Optional arguments @@ -9566,22 +9591,34 @@ function parse_real_list2 (lat, err_str, real_array, num_found, delim, delim_fou num_expect = integer_option(10, num_expected) default_val = real_option(0.0_rp, default_value) -op_delim = '(' -cl_delim = ')' +op_brace = '(' +cl_brace = ')' sep = ',' -if (present(open_delim)) op_delim = open_delim -if (present(close_delim)) cl_delim = close_delim +if (present(open_brace)) op_brace = open_brace +if (present(close_brace)) cl_brace = close_brace if (present(separator)) sep = separator -! Expect op_delim -call get_next_word (word, ix_word, op_delim, delim, delim_found) +! Expect op_brace +if (logic_option(.true., brace_optional)) then + call get_next_word (word, ix_word, op_brace // ',', delim, delim_found) + if (delim == ',') then ! Array with single value + num_found = 1 + call re_allocate(real_array, 1) + call parse_evaluate_value ('BAD REAL NUMBER IN: ' // err_str, real_array(1), lat, delim, delim_found, err_flag, string_in = word) + is_ok = (.not. err_flag) + return + endif +else + call get_next_word (word, ix_word, op_brace, delim, delim_found) +endif + if (word /= '') then - call parser_error ('EXPECTED OPENING DELIMITER ' // quote(op_delim) // ' FOR VECTOR FOR: ' // err_str, & + call parser_error ('EXPECTED OPENING DELIMITER ' // quote(op_brace) // ' FOR VECTOR FOR: ' // err_str, & 'BUT GOT: ' // word) return -elseif (delim /= op_delim) then +elseif (delim /= op_brace) then call parser_error ('BAD OPENING DELIMITER FOR VECTOR FOR: ' // err_str, & - 'EXPECTED: ' // quote(op_delim) // ' BUT GOT: ' // delim) + 'EXPECTED: ' // quote(op_brace) // ' BUT GOT: ' // delim) return end if @@ -9594,7 +9631,7 @@ function parse_real_list2 (lat, err_str, real_array, num_found, delim, delim_fou num_found = 0 do - call parse_evaluate_value ('BAD REAL NUMBER IN: ' // err_str, value, lat, delim, delim_found, err_flag, sep // cl_delim) + call parse_evaluate_value ('BAD REAL NUMBER IN: ' // err_str, value, lat, delim, delim_found, err_flag, sep // cl_brace) if (err_flag) return ! real is found num_found = num_found + 1 @@ -9607,8 +9644,8 @@ function parse_real_list2 (lat, err_str, real_array, num_found, delim, delim_fou ! Set value real_array(num_found) = value - ! Exit if cl_delim is found - if (delim == cl_delim) exit + ! Exit if cl_brace is found + if (delim == cl_brace) exit ! Check separator if (delim /= sep) then diff --git a/bmad/parsing/read_digested_bmad_file.f90 b/bmad/parsing/read_digested_bmad_file.f90 index 8cebe94674..b5b3bf3502 100644 --- a/bmad/parsing/read_digested_bmad_file.f90 +++ b/bmad/parsing/read_digested_bmad_file.f90 @@ -498,7 +498,7 @@ subroutine read_this_ele (ele, ix_ele_in, error) integer i_min(3), i_max(3), ix_ele_in, ix_t(6), ios, k_max, ix_e, n_angle, n_energy integer ix_r, ix_s, n_var, ix_d, ix_m, idum, n_cus, ix_convert, ix_c integer ix_sr_long, ix_sr_trans, ix_lr_mode, ix_wall3d_branch, ix_st(0:3) -integer i0, i1, j0, j1, j2, ix_ptr, lb(3), ub(3), nt, n0, n1, n2, nn(7), ne, nr, ns, nc +integer i0, i1, j0, j1, j2, ix_ptr, lb(3), ub(3), nt, n0, n1, n2, nn(7), ne, nr, ns, nc, n_foil logical error, is_alloc_grid, is_alloc_pix, is_alloc_ref_sigma, is_alloc_ref_pi, is_alloc_eprob logical ac_kicker_alloc, rad_map_alloc @@ -510,7 +510,7 @@ subroutine read_this_ele (ele, ix_ele_in, error) read (d_unit, err = 9100, end = 9100) & mode3, ix_r, ix_s, ix_wall3d_branch, ac_kicker_alloc, rad_map_alloc, & ix_convert, ix_d, ix_m, ix_t, ix_st, ix_e, ix_sr_long, ix_sr_trans, & - ix_lr_mode, ix_wall3d, ix_c, n_cart, n_cyl, n_gen, n_grid, idum, n_cus, ix_convert ! idum not used + ix_lr_mode, ix_wall3d, ix_c, n_cart, n_cyl, n_gen, n_grid, n_foil, n_cus, ix_convert read (d_unit, err = 9100, end = 9100) & ele%name, ele%type, ele%alias, ele%component_name, ele%x, ele%y, & @@ -597,6 +597,16 @@ subroutine read_this_ele (ele, ix_ele_in, error) endif endif +! Foil + +if (n_foil > 0) then + allocate(ele%foil) + allocate(ele%foil%material(n_foil)) + do n = 1, n_foil + read (d_unit, err = 9120, end = 9120) ele%foil%material(n) + enddo +endif + ! Converter if (ix_convert == 1) then diff --git a/bmad/parsing/set_ele_defaults.f90 b/bmad/parsing/set_ele_defaults.f90 index e8eb51b867..3b2b3d251f 100644 --- a/bmad/parsing/set_ele_defaults.f90 +++ b/bmad/parsing/set_ele_defaults.f90 @@ -158,11 +158,14 @@ subroutine set_ele_defaults (ele, do_allocate) case (foil$) ele%value(num_steps$) = 10 ele%value(final_charge$) = real_garbage$ - ele%value(scatter$) = true$ ele%value(x1_edge$) = -99.0_rp ele%value(y1_edge$) = -99.0_rp ele%value(x2_edge$) = 99.0_rp ele%value(y2_edge$) = 99.0_rp + ele%value(f_factor$) = 0.95_rp + ele%value(scatter_method$) = highland$ + if (associated(ele%foil)) deallocate(ele%foil) + allocate(ele%foil) case (girder$) ele%value(origin_ele_ref_pt$) = center_pt$ diff --git a/bmad/parsing/write_digested_bmad_file.f90 b/bmad/parsing/write_digested_bmad_file.f90 index 6c1157c5cd..673eb06fc7 100644 --- a/bmad/parsing/write_digested_bmad_file.f90 +++ b/bmad/parsing/write_digested_bmad_file.f90 @@ -233,7 +233,7 @@ subroutine write_this_ele (ele) integer ix_wall3d, ix_r, ix_d, ix_m, ix_e, ix_t(6), ix_st(0:3), ie, ib, ix_wall3d_branch integer ix_sr_long, ix_sr_trans, ix_lr_mode, ie_max, ix_s, n_var, ix_ptr, im, n1, n2 integer i, j, k, n, nr, n_gen, n_grid, n_cart, n_cyl, ix_ele, ix_c, ix_branch -integer n_cus, ix_convert, n_energy, n_angle +integer n_cus, ix_convert, n_energy, n_angle, n_foil logical write_wake, mode3 @@ -242,7 +242,7 @@ subroutine write_this_ele (ele) ix_d = 0; ix_m = 0; ix_e = 0; ix_t = -1; ix_r = 0; ix_s = 0 ix_sr_long = 0; ix_sr_trans = 0; ix_lr_mode = 0; ix_st = -1 mode3 = .false.; ix_wall3d = 0; ix_convert = 0; ix_c = 0 -n_cart = 0; n_gen = 0; n_grid = 0; n_cyl = 0; n_cus = 0 +n_cart = 0; n_gen = 0; n_grid = 0; n_cyl = 0; n_cus = 0; n_foil = 0 if (associated(ele%mode3)) mode3 = .true. if (associated(ele%cartesian_map)) n_cart = size(ele%cartesian_map) @@ -250,6 +250,7 @@ subroutine write_this_ele (ele) if (associated(ele%gen_grad_map)) n_gen = size(ele%gen_grad_map) if (associated(ele%grid_field)) n_grid = size(ele%grid_field) if (associated(ele%custom)) n_cus = size(ele%custom) +if (associated(ele%foil)) n_foil = size(ele%foil%material) if (associated(ele%converter)) ix_convert = 1 if (associated(ele%r)) ix_r = 1 if (associated(ele%photon)) ix_s = 1 @@ -318,7 +319,7 @@ subroutine write_this_ele (ele) write (d_unit) mode3, ix_r, ix_s, ix_wall3d_branch, associated(ele%ac_kick), associated(ele%rad_map), & ix_convert, ix_d, ix_m, ix_t, ix_st, ix_e, ix_sr_long, ix_sr_trans, & - ix_lr_mode, ix_wall3d, ix_c, n_cart, n_cyl, n_gen, n_grid, -999, n_cus, ix_convert + ix_lr_mode, ix_wall3d, ix_c, n_cart, n_cyl, n_gen, n_grid, n_foil, n_cus, ix_convert write (d_unit) & ele%name, ele%type, ele%alias, ele%component_name, ele%x, ele%y, & @@ -398,6 +399,14 @@ subroutine write_this_ele (ele) endif endif +! Foil + +if (associated(ele%foil)) then + do n = 1, size(ele%foil%material) + write (d_unit) ele%foil%material(n) + enddo +endif + ! Converter if (associated(ele%converter)) then diff --git a/bmad/searchf.namelist b/bmad/searchf.namelist index a58872ef4b..1cb0fc23d5 100644 --- a/bmad/searchf.namelist +++ b/bmad/searchf.namelist @@ -1730,6 +1730,9 @@ short$ user_set$ first_pass$ multipass_ref_energy_name +highland$ +lynch_dahl$ +scatter_method_name interval1_coef_struct photon_reflect_table_struct photon_reflect_surface_struct @@ -1956,6 +1959,8 @@ converter_dir_2d_struct converter_dir_coef_struct converter_direction_out_struct converter_sub_distribution_struct +material_struct +foil_struct converter_distribution_struct converter_struct control_struct @@ -2133,72 +2138,39 @@ inherit_from_fork$ ref_tilt$ direction$ repetition_frequency$ -kick$ -x_gain_err$ -taylor_order$ -r_solenoid$ -final_charge$ k1$ kx$ harmon$ h_displace$ y_gain_err$ -critical_angle_factor$ -tilt_corr$ -ref_coords$ -dt_max$ -radiation_length$ graze_angle$ k2$ b_max$ v_displace$ gradient_tot$ harmon_master$ -ks$ -flexible$ -crunch$ -ref_orbit_follows$ -pc_out_min$ -radiation_length_used$ gradient$ k3$ noise$ new_branch$ ix_branch$ g_max$ -g$ -symmetry$ -field_scale_factor$ -pc_out_max$ -density$ dg$ bbi_const$ osc_amplitude$ ix_to_branch$ angle_out_max$ -gradient_err$ -critical_angle$ -bragg_angle_in$ -spin_dn_dpz_x$ -density_used$ delta_e_ref$ interpolation$ bragg_angle_out$ k1x$ spin_dn_dpz_y$ -charge$ -x_gain_calib$ -ix_to_element$ -voltage$ -g_tot$ -area_density$ rho$ voltage_err$ bragg_angle$ k1y$ n_particle$ spin_dn_dpz_z$ -area_density_used$ fringe_type$ dbragg_angle_de$ fringe_at$ @@ -2229,117 +2201,54 @@ autoscale_amplitude$ d1_thickness$ default_tracking_species$ autoscale_phase$ -n_slice$ -y_gain_calib$ -sig_e2$ fb1$ polarity$ crunch_calib$ alpha_angle$ d2_thickness$ -beta_a_strong$ -beta_a_out$ -e_loss$ -gap$ -spin_x$ -e_center$ fb2$ x_offset_calib$ v1_unitcell$ psi_angle$ cavity_type$ -beta_b_strong$ -beta_b_out$ -spin_y$ -e2_center$ -n_period$ -emit_fraction$ -x1_edge$ y_offset_calib$ v_unitcell$ v2_unitcell$ spin_z$ l_period$ -fq1$ -alpha_a_strong$ -alpha_a_out$ -e2_probability$ -phi0_max$ -x2_edge$ fq2$ phi0$ tilt_calib$ e_center_relative_to_ref$ y1_edge$ -alpha_b_strong$ -alpha_b_out$ -is_mosaic$ -px_aperture_width2$ phi0_err$ current$ mosaic_thickness$ px_aperture_center$ -y2_edge$ -eta_x_out$ -quad_tilt$ -de_eta_meas$ -spatial_distribution$ -species_strong$ eta_y_out$ -bend_tilt$ mode$ velocity_distribution$ py_aperture_width2$ -phi0_multipass$ -n_sample$ -origin_ele_ref_pt$ -mosaic_angle_rms_in_plane$ -eps_step_scale$ -e_tot_strong$ etap_x_out$ phi0_autoscale$ dx_origin$ energy_distribution$ -x_quad$ -ds_photon_slice$ -mosaic_angle_rms_out_plane$ -py_aperture_center$ -x_dispersion_err$ etap_y_out$ dy_origin$ y_quad$ e_field_x$ -b_field_tot$ -y_dispersion_err$ -z_aperture_width2$ -user_sets_length$ -rf_clock_harmonic$ upstream_coord_dir$ dz_origin$ mosaic_diffraction_num$ -z_aperture_center$ -cmat_11$ -field_autoscale$ -l_sagitta$ -e_field_y$ -x_dispersion_calib$ cmat_12$ dtheta_origin$ b_param$ l_chord$ -scale_field_to_one$ -downstream_coord_dir$ -pz_aperture_width2$ -y_dispersion_calib$ -voltage_tot$ cmat_21$ l_active$ dphi_origin$ split_id$ ref_cap_gamma$ -l_soft_edge$ -transverse_sigma_cut$ -pz_aperture_center$ cmat_22$ dpsi_origin$ t_offset$ @@ -2447,6 +2356,7 @@ x_ref$ species_out$ y_knot$ eta_y$ +density$ lr_wake_file$ px_ref$ elliptical_curvature_x$ @@ -2467,10 +2377,12 @@ machine$ taylor_map_includes_offsets$ pixel$ p88$ +radiation_length$ csr_method$ var$ z_ref$ p89$ +radiation_length_used$ pz_ref$ space_charge_method$ p90$ diff --git a/regression_tests/tracking_method_test/output.correct b/regression_tests/tracking_method_test/output.correct index 45d7e328fd..d434bfe25d 100644 --- a/regression_tests/tracking_method_test/output.correct +++ b/regression_tests/tracking_method_test/output.correct @@ -682,7 +682,7 @@ "MULTILAYER_MIRROR1:E_Field" REL 2E-07 5.9486744921E-02 1.1908936166E-01 "MULTILAYER_MIRROR1: Bmad_Standard dSpin" ABS 1E-8 0.000000000 0.000000000 0.000000000 0.000000000 -"FOIL1: Bmad_Standard" ABS 2e-14 1.0000000000E-03 -1.0891105964E-03 3.0000000000E-03 4.7731198777E-03 5.0000000000E-03 -3.8231444384E-01 1.7840566402E-03 +"FOIL1: Bmad_Standard" ABS 2e-14 1.0000000000E-03 -4.7205819283E-03 3.0000000000E-03 -4.8669120667E-03 5.0000000000E-03 -3.8231444384E-01 1.7840566402E-03 "FOIL1: Bmad_Standard dSpin" ABS 1E-8 0.000000000 0.000000000 0.000000000 0.000000000 "AB_MULTIPOLE1-Anti_D: Bmad_Standard" ABS 2e-14 1.0000000000E-03 -4.9552061312E-02 3.0000000000E-03 1.2965766811E-02 5.0000000000E-03 6.0000000000E-03 0.0000000000E+00 @@ -1200,7 +1200,7 @@ "E_GUN1-Anti_D: Time_Runge_Kutta" ABS 1e-13 -2.9626159138E-03 -2.3431192160E-03 9.7658059996E-03 3.8063408764E-03 -4.1486845348E+00 3.7692757746E-01 2.0924584042E+00 "E_GUN1-Anti_D: Time_Runge_Kutta dSpin" ABS 1E-8 -0.001742291 0.000549589 0.000602004 0.000000000 -"FOIL1-Anti_D: Bmad_Standard" ABS 2e-14 1.0000000000E-03 3.5434072385E-03 3.0000000000E-03 1.3833103015E-04 5.0000000000E-03 -3.8269521695E-01 1.7859830560E-03 +"FOIL1-Anti_D: Bmad_Standard" ABS 2e-14 1.0000000000E-03 6.5921225879E-03 3.0000000000E-03 1.6030655459E-02 5.0000000000E-03 -3.8269521695E-01 1.7859830560E-03 "FOIL1-Anti_D: Bmad_Standard dSpin" ABS 1E-8 0.000000000 0.000000000 0.000000000 0.000000000 "AB_MULTIPOLE1-Anti_O: Bmad_Standard" ABS 2e-14 1.0000000000E-03 -4.9552061312E-02 3.0000000000E-03 1.2965766811E-02 5.0000000000E-03 6.0000000000E-03 0.0000000000E+00 @@ -1715,7 +1715,7 @@ "LCAVITY3-Anti_O: Runge_Kutta dSpin" ABS 1E-8 0.000015457 -0.000009416 -0.000001742 0.000000000 "LCAVITY3-Anti_O: Time_Runge_Kutta dSpin" ABS 1E-8 0.000015457 -0.000009416 -0.000001742 -0.000000000 -"FOIL1-Anti_O: Bmad_Standard" ABS 2e-14 1.0000000000E-03 1.3313038573E-04 3.0000000000E-03 3.5486078829E-03 5.0000000000E-03 -3.8269521695E-01 1.7859830560E-03 +"FOIL1-Anti_O: Bmad_Standard" ABS 2e-14 1.0000000000E-03 -3.3737730989E-03 3.0000000000E-03 -7.6916806996E-04 5.0000000000E-03 -3.8269521695E-01 1.7859830560E-03 "FOIL1-Anti_O: Bmad_Standard dSpin" ABS 1E-8 0.000000000 0.000000000 0.000000000 0.000000000 "AB_MULTIPOLE1-Anti_OD: Bmad_Standard" ABS 2e-14 1.0000000000E-03 -4.9552061312E-02 3.0000000000E-03 1.2965766811E-02 5.0000000000E-03 6.0000000000E-03 0.0000000000E+00 @@ -2230,6 +2230,6 @@ "LCAVITY3-Anti_OD: Runge_Kutta dSpin" ABS 1E-8 0.000012397 0.000001196 -0.000008395 0.000000000 "LCAVITY3-Anti_OD: Time_Runge_Kutta dSpin" ABS 1E-8 0.000012397 0.000001196 -0.000008395 0.000000000 -"FOIL1-Anti_OD: Bmad_Standard" ABS 2e-14 1.0000000000E-03 5.1800689189E-03 3.0000000000E-03 -1.4960596376E-03 5.0000000000E-03 -3.8231444384E-01 1.7840566402E-03 +"FOIL1-Anti_OD: Bmad_Standard" ABS 2e-14 1.0000000000E-03 -1.1333658746E-02 3.0000000000E-03 1.3714104750E-02 5.0000000000E-03 -3.8231444384E-01 1.7840566402E-03 "FOIL1-Anti_OD: Bmad_Standard dSpin" ABS 1E-8 0.000000000 0.000000000 0.000000000 0.000000000 diff --git a/regression_tests/xraylib_test/output.correct b/regression_tests/xraylib_test/output.correct index 75b811c1cd..beb8474ef3 100644 --- a/regression_tests/xraylib_test/output.correct +++ b/regression_tests/xraylib_test/output.correct @@ -10,6 +10,8 @@ "Fe-E1" REL 1E-8 6.631752363E+06 "Fe-E2" REL 1E-8 6.385322149E+05 "Fe-E2" REL 1E-8 3.859369011E+06 +"Fe-Weight" REL 1E-8 5.585000000E+01 +"Fe-Density" REL 1E-8 7.874000000E+00 "Compound_Names" STR "OK" "Bragg_In" REL 1E-8 0.4077688908 "Bragg_Out" REL 1E-8 0.3688184484 diff --git a/regression_tests/xraylib_test/xraylib_test.f90 b/regression_tests/xraylib_test/xraylib_test.f90 index 487a2f97ab..ff40b3ac94 100644 --- a/regression_tests/xraylib_test/xraylib_test.f90 +++ b/regression_tests/xraylib_test/xraylib_test.f90 @@ -48,6 +48,9 @@ program xraylib_test call photon_absorption_and_phase_shift ('Fe', 2*Energy, absorption, phase_shift, err_flag) write (1, '(a, es18.9)') '"Fe-E2" REL 1E-8', absorption write (1, '(a, es18.9)') '"Fe-E2" REL 1E-8', phase_shift +n = atomic_number(species_id("Fe")) +write (1, '(a, es18.9)') '"Fe-Weight" REL 1E-8', atomicweight(n) +write (1, '(a, es18.9)') '"Fe-Density" REL 1E-8', elementdensity(n) ! diff --git a/sim_utils/interfaces/particle_species_mod.f90 b/sim_utils/interfaces/particle_species_mod.f90 index 094482a3b3..c52bcf706e 100755 --- a/sim_utils/interfaces/particle_species_mod.f90 +++ b/sim_utils/interfaces/particle_species_mod.f90 @@ -45,7 +45,6 @@ module particle_species_mod use output_mod -use sim_utils_struct use sign_of_mod implicit none @@ -794,6 +793,76 @@ module particle_species_mod contains +!-------------------------------------------------------------------------------------------- +!-------------------------------------------------------------------------------------------- +!-------------------------------------------------------------------------------------------- +!+ +! Subroutine molecular_components(molecule, component) +! +! Routine to decompose a molecule into its components. +! For example: molecule = 'H2O' => component(1) = ('H', 2), component(2) = ('O', 1) +! +! Input: +! molecule -- character(*): Molecular name. +! +! Output: +! component(:) -- molecular_component_struct, allocatable: Array of components. +!- + +subroutine molecular_components(molecule, component) + +implicit none + +type (molecular_component_struct), allocatable :: component(:), temp(:) + +integer ix, n, leng + +character(*) molecule +character(100) name, num + +logical err + +! + +name = molecule +n = 0 +ix = index(name, '#') + 1 +if (ix > 1) then ! Get rid of "#12C" like construct + do + if (index('1234567890', name(ix:ix)) == 0) exit + ix = ix + 1 + enddo +endif + +if (allocated(component)) deallocate(component) +allocate(component(100)) + +do + if (name(ix:ix) == '+' .or. name(ix:ix) == '-' .or. name(ix:ix) == ' ') exit + n = n + 1 + if (index('abcdefghijklmnopqrstuvwxyz', name(ix+1:ix+1)) > 0) then + component(n)%atom = name(ix:ix+1) + ix = ix + 2 + else + component(n)%atom = name(ix:ix) + ix = ix + 1 + endif + + num = '' + do + if (index('1234567890', name(ix:ix)) == 0) exit + num = trim(num) // name(ix:ix) + ix = ix + 1 + enddo + component(n)%number = string_to_int(num, 1, err, .false.) +enddo + +call move_alloc(component, temp) +allocate(component(n)) +component = temp(1:n) + +end subroutine molecular_components + !-------------------------------------------------------------------------------------------- !-------------------------------------------------------------------------------------------- !-------------------------------------------------------------------------------------------- @@ -870,7 +939,7 @@ end function species_of ! For all other types of particles, the case does matter. ! ! Input: -! name -- character(20): Name of the species. +! name -- character(*): Name of the species. ! default -- integer, optional: Default species to use if name is blank or 'ref_species'. ! If not present, a blank name is an error. ! print_err -- logical, optional: Print error message? Default is True. If False, return species = invalid$, @@ -1646,25 +1715,25 @@ end function x0_radiation_length !+ ! Function atomic_number(species) result (atomic_num) ! -! Routine to return the atomic number Z if species argument corresponds to an atomic particle or is a proton. -! Set to zero otherwise. +! Routine to return the atomic number Z if species argument corresponds to an atomic particle or is a proton +! or the particle charge if a fundamental particle. Set to zero otherwise (for molecules). ! ! Input: ! species -- integer: Spicies ID. ! ! Output: -! atomic_num -- Integer: Atomic index. Set to zero if species is not atomic +! atomic_num -- Integer: Atomic index. Set to zero if a molecule !- -elemental function atomic_number(species) result (atomic_num) +function atomic_number(species) result (atomic_num) integer, intent(in) :: species integer atomic_num ! -if (species == proton$) then - atomic_num = 1 +if (is_subatomic_species(species)) then + atomic_num = charge_of(species) return endif diff --git a/sim_utils/interfaces/sim_utils_struct.f90 b/sim_utils/interfaces/sim_utils_struct.f90 index 8d6f0255d4..d74555d9fb 100644 --- a/sim_utils/interfaces/sim_utils_struct.f90 +++ b/sim_utils/interfaces/sim_utils_struct.f90 @@ -70,6 +70,13 @@ module sim_utils_struct character(*), parameter :: invalid_name = 'INVALID!' +! Molecular component + +type molecular_component_struct + character(2) :: atom = '' + integer :: number = 0 +end type + ! integer, parameter :: x_axis$ = 1, y_axis$ = 2, z_axis$ = 3 diff --git a/sim_utils/searchf.namelist b/sim_utils/searchf.namelist index 742ba3e011..0755ce9dbe 100644 --- a/sim_utils/searchf.namelist +++ b/sim_utils/searchf.namelist @@ -171,6 +171,7 @@ lf$ invalid$ not_set$ invalid_name +molecular_component_struct x_axis$ y_axis$ z_axis$ @@ -342,6 +343,7 @@ atomic_name atom_struct mean_excitation_energy_over_z molecular_name +molecuar_components antiparticle species_of species_id diff --git a/tao/searchf.namelist b/tao/searchf.namelist index 0ee04c0ae5..7f493fd598 100644 --- a/tao/searchf.namelist +++ b/tao/searchf.namelist @@ -668,6 +668,8 @@ tao_var_merit_type_name tao_data_merit_type_name tao_optimizer_name tao_shape_shape_name +present_str +negated_str tao_shape_label_name tao_wave_data_name n_char_show diff --git a/tao/version/tao_version_mod.f90 b/tao/version/tao_version_mod.f90 index 3989257aa6..f6f2131917 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/12/23 21:38:46" +character(*), parameter :: tao_version_date = "2024/01/04 04:51:30" end module diff --git a/util_programs/element_attributes/element_attributes.dat b/util_programs/element_attributes/element_attributes.dat index 870fed5b67..9a6c518e89 100644 --- a/util_programs/element_attributes/element_attributes.dat +++ b/util_programs/element_attributes/element_attributes.dat @@ -1,4 +1,4 @@ - 2023-09-29 01:08:46 + 2024-01-05 21:56:35 1 Drift 20 !Bmad_Com 2 Sbend 29 !Line @@ -63,9 +63,10 @@ 61 Crab_Cavity 13 Sol_Quad 62 Ramper 23 Solenoid 63 !PTC_Com 8 Taylor - 64 RF_Bend 51 Undulator - 65 GKicker 34 VKicker - 66 Foil 12 Wiggler + 64 RF_Bend 67 Thick_Multipole + 65 GKicker 51 Undulator + 66 Foil 34 VKicker + 67 Thick_Multipole 12 Wiggler !--------------------------------- 20 !Bmad_Com @@ -169,11 +170,9 @@ 13 PHASE_Y 16 SIG_Z 19 SIG_PZ - 20 TIME_DIR 21 SPIN_X 22 SPIN_Y 23 SPIN_Z - 24 DIRECTION 39 EMITTANCE_A 40 EMITTANCE_B 41 EMITTANCE_Z @@ -197,6 +196,7 @@ 58 Y_OFFSET_TOT 59 Z_OFFSET_TOT 60 TILT_TOT + 63 dispatch [private] 64 REF_TIME_START 71 X1_LIMIT 72 X2_LIMIT @@ -267,6 +267,7 @@ 59 Z_OFFSET_TOT 60 TILT_TOT 62 MULTIPASS_REF_ENERGY [private] + 63 dispatch [private] 64 REF_TIME_START 65 INTEGRATOR_ORDER 66 NUM_STEPS @@ -376,6 +377,7 @@ 58 Y_OFFSET_TOT 59 Z_OFFSET_TOT 60 TILT_TOT + 63 dispatch [private] 64 REF_TIME_START 71 X1_LIMIT 72 X2_LIMIT @@ -467,6 +469,7 @@ 58 Y_OFFSET_TOT 59 Z_OFFSET_TOT 60 TILT_TOT + 63 dispatch [private] 64 REF_TIME_START 71 X1_LIMIT 72 X2_LIMIT @@ -519,6 +522,7 @@ 58 Y_OFFSET_TOT 59 Z_OFFSET_TOT 60 TILT_TOT + 63 dispatch [private] 64 REF_TIME_START 71 X1_LIMIT 72 X2_LIMIT @@ -559,13 +563,14 @@ 1 L 2 TILT 4 HARMON + 5 HARMON_MASTER 6 GRADIENT 8 VOLTAGE 15 RF_FREQUENCY 16 RF_WAVELENGTH 17 STATIC_LINEAR_MAP - 18 AUTOSCALE_AMPLITUDE [private] - 19 AUTOSCALE_PHASE [private] + 19 AUTOSCALE_AMPLITUDE [private] + 20 AUTOSCALE_PHASE [private] 24 PHI0 26 PHI0_MULTIPASS 27 PHI0_AUTOSCALE [private] @@ -592,6 +597,7 @@ 59 Z_OFFSET_TOT 60 TILT_TOT 62 MULTIPASS_REF_ENERGY [private] + 63 dispatch [private] 64 REF_TIME_START 65 INTEGRATOR_ORDER 66 NUM_STEPS @@ -694,6 +700,7 @@ 59 Z_OFFSET_TOT 60 TILT_TOT 61 REF_TILT_TOT + 63 dispatch [private] 64 REF_TIME_START 65 THICKNESS 70 REF_WAVELENGTH @@ -770,6 +777,7 @@ 59 Z_OFFSET_TOT 60 TILT_TOT 62 MULTIPASS_REF_ENERGY [private] + 63 dispatch [private] 64 REF_TIME_START 65 INTEGRATOR_ORDER 66 NUM_STEPS @@ -860,6 +868,7 @@ 58 Y_OFFSET_TOT 59 Z_OFFSET_TOT 60 TILT_TOT + 63 dispatch [private] 64 REF_TIME_START 71 X1_LIMIT 72 X2_LIMIT @@ -920,6 +929,7 @@ 58 Y_OFFSET_TOT 59 Z_OFFSET_TOT 60 TILT_TOT + 63 dispatch [private] 64 REF_TIME_START 70 REF_WAVELENGTH 71 X1_LIMIT @@ -984,6 +994,7 @@ 59 Z_OFFSET_TOT 60 TILT_TOT 62 MULTIPASS_REF_ENERGY [private] + 63 dispatch [private] 64 REF_TIME_START 65 INTEGRATOR_ORDER 66 NUM_STEPS @@ -1061,6 +1072,7 @@ 59 Z_OFFSET_TOT 60 TILT_TOT 62 MULTIPASS_REF_ENERGY [private] + 63 dispatch [private] 64 REF_TIME_START 65 INTEGRATOR_ORDER 66 NUM_STEPS @@ -1130,9 +1142,10 @@ 15 RF_FREQUENCY 16 RF_WAVELENGTH 17 STATIC_LINEAR_MAP - 18 AUTOSCALE_AMPLITUDE - 19 AUTOSCALE_PHASE - 20 CONSTANT_REF_ENERGY + 18 CONSTANT_REF_ENERGY + 19 AUTOSCALE_AMPLITUDE + 20 AUTOSCALE_PHASE + 21 POLARITY 24 PHI0 25 PHI0_ERR 27 PHI0_AUTOSCALE @@ -1156,6 +1169,7 @@ 59 Z_OFFSET_TOT 60 TILT_TOT 62 MULTIPASS_REF_ENERGY [private] + 63 dispatch [private] 64 REF_TIME_START 65 INTEGRATOR_ORDER 66 NUM_STEPS @@ -1227,8 +1241,8 @@ 15 RF_FREQUENCY 16 RF_WAVELENGTH 17 STATIC_LINEAR_MAP - 18 AUTOSCALE_AMPLITUDE - 19 AUTOSCALE_PHASE + 19 AUTOSCALE_AMPLITUDE + 20 AUTOSCALE_PHASE 22 EMIT_FRACTION 24 PHI0 25 PHI0_ERR @@ -1256,6 +1270,7 @@ 59 Z_OFFSET_TOT 60 TILT_TOT 62 MULTIPASS_REF_ENERGY [private] + 63 dispatch [private] 64 REF_TIME_START 65 INTEGRATOR_ORDER 66 NUM_STEPS @@ -1348,6 +1363,7 @@ 59 Z_OFFSET_TOT 60 TILT_TOT 62 MULTIPASS_REF_ENERGY [private] + 63 dispatch [private] 64 REF_TIME_START 65 INTEGRATOR_ORDER 66 NUM_STEPS @@ -1485,6 +1501,18 @@ 66 Foil 1 L 2 TILT + 3 FINAL_CHARGE + 4 RADIATION_LENGTH + 5 RADIATION_LENGTH_USED + 6 DENSITY + 7 DENSITY_USED + 8 AREA_DENSITY + 9 AREA_DENSITY_USED + 21 SCATTER + 22 X1_EDGE + 23 X2_EDGE + 24 Y1_EDGE + 25 Y2_EDGE 34 X_PITCH 35 Y_PITCH 36 X_OFFSET @@ -1501,6 +1529,7 @@ 58 Y_OFFSET_TOT 59 Z_OFFSET_TOT 60 TILT_TOT + 63 dispatch [private] 64 REF_TIME_START 65 THICKNESS 71 X1_LIMIT @@ -1660,6 +1689,7 @@ 83 Y_KNOT 84 SLAVE 89 VAR + 105 IS_ON 112 DESCRIP 117 TYPE 128 ACCORDION_EDGE @@ -1695,6 +1725,7 @@ 59 Z_OFFSET_TOT 60 TILT_TOT 62 MULTIPASS_REF_ENERGY [private] + 63 dispatch [private] 64 REF_TIME_START 65 INTEGRATOR_ORDER 66 NUM_STEPS @@ -1841,6 +1872,7 @@ 59 Z_OFFSET_TOT 60 TILT_TOT 62 MULTIPASS_REF_ENERGY [private] + 63 dispatch [private] 64 REF_TIME_START 65 INTEGRATOR_ORDER 66 NUM_STEPS @@ -1926,6 +1958,7 @@ 59 Z_OFFSET_TOT 60 TILT_TOT 62 MULTIPASS_REF_ENERGY [private] + 63 dispatch [private] 64 REF_TIME_START 65 INTEGRATOR_ORDER 66 NUM_STEPS @@ -2000,9 +2033,9 @@ 15 RF_FREQUENCY 16 RF_WAVELENGTH 17 STATIC_LINEAR_MAP - 18 AUTOSCALE_AMPLITUDE - 19 AUTOSCALE_PHASE - 20 LONGITUDINAL_MODE + 18 LONGITUDINAL_MODE + 19 AUTOSCALE_AMPLITUDE + 20 AUTOSCALE_PHASE 21 E_LOSS 22 CAVITY_TYPE 24 PHI0 @@ -2039,6 +2072,7 @@ 59 Z_OFFSET_TOT 60 TILT_TOT 62 MULTIPASS_REF_ENERGY [private] + 63 dispatch [private] 64 REF_TIME_START 65 INTEGRATOR_ORDER 66 NUM_STEPS @@ -2117,6 +2151,7 @@ 58 Y_OFFSET_TOT 59 Z_OFFSET_TOT 60 TILT_TOT + 63 dispatch [private] 64 REF_TIME_START 71 X1_LIMIT 72 X2_LIMIT @@ -2189,6 +2224,7 @@ 58 Y_OFFSET_TOT 59 Z_OFFSET_TOT 60 TILT_TOT + 63 dispatch [private] 64 REF_TIME_START 71 X1_LIMIT 72 X2_LIMIT @@ -2247,6 +2283,7 @@ 58 Y_OFFSET_TOT 59 Z_OFFSET_TOT 60 TILT_TOT + 63 dispatch [private] 64 REF_TIME_START 70 REF_WAVELENGTH 71 X1_LIMIT @@ -2320,12 +2357,9 @@ 39 PY1 40 Z1 41 PZ1 - 42 PHASE_TROMBONE_INPUT - 43 PHASE_TROMBONE - 44 MATCH_END_INPUT - 45 MATCH_END - 46 MATCH_END_ORBIT_INPUT - 47 MATCH_END_ORBIT + 42 MATRIX + 43 KICK0 + 44 RECALC 48 DELTA_TIME 50 DELTA_REF_TIME 51 p0c_start [private] @@ -2389,6 +2423,7 @@ 59 Z_OFFSET_TOT 60 TILT_TOT 61 REF_TILT_TOT + 63 dispatch [private] 64 REF_TIME_START 70 REF_WAVELENGTH 71 X1_LIMIT @@ -2474,6 +2509,7 @@ 59 Z_OFFSET_TOT 60 TILT_TOT 62 MULTIPASS_REF_ENERGY [private] + 63 dispatch [private] 64 REF_TIME_START 65 INTEGRATOR_ORDER 66 NUM_STEPS @@ -2553,6 +2589,7 @@ 59 Z_OFFSET_TOT 60 TILT_TOT 61 REF_TILT_TOT + 63 dispatch [private] 64 REF_TIME_START 70 REF_WAVELENGTH 71 X1_LIMIT @@ -2607,6 +2644,7 @@ 58 Y_OFFSET_TOT 59 Z_OFFSET_TOT 60 TILT_TOT + 63 dispatch [private] 64 REF_TIME_START 71 X1_LIMIT 72 X2_LIMIT @@ -2690,6 +2728,7 @@ 59 Z_OFFSET_TOT 60 TILT_TOT 62 MULTIPASS_REF_ENERGY [private] + 63 dispatch [private] 64 REF_TIME_START 65 INTEGRATOR_ORDER 66 NUM_STEPS @@ -2900,6 +2939,7 @@ 58 Y_OFFSET_TOT 59 Z_OFFSET_TOT 60 TILT_TOT + 63 dispatch [private] 64 REF_TIME_START 70 REF_WAVELENGTH 71 X1_LIMIT @@ -2978,6 +3018,7 @@ 59 Z_OFFSET_TOT 60 TILT_TOT 62 MULTIPASS_REF_ENERGY [private] + 63 dispatch [private] 64 REF_TIME_START 65 INTEGRATOR_ORDER 66 NUM_STEPS @@ -3065,6 +3106,7 @@ 59 Z_OFFSET_TOT 60 TILT_TOT 62 MULTIPASS_REF_ENERGY [private] + 63 dispatch [private] 64 REF_TIME_START 65 INTEGRATOR_ORDER 66 NUM_STEPS @@ -3130,6 +3172,7 @@ 2 ROLL 3 REF_TILT 4 HARMON + 5 HARMON_MASTER 6 G 7 DG [private] 9 RHO @@ -3169,6 +3212,7 @@ 60 ROLL_TOT 61 REF_TILT_TOT 62 MULTIPASS_REF_ENERGY [private] + 63 dispatch [private] 64 REF_TIME_START 65 INTEGRATOR_ORDER 66 NUM_STEPS @@ -3227,6 +3271,7 @@ 1 L 2 TILT 4 HARMON + 5 HARMON_MASTER 6 GRADIENT 7 gradient_err [private] 8 VOLTAGE @@ -3237,9 +3282,9 @@ 15 RF_FREQUENCY 16 RF_WAVELENGTH 17 STATIC_LINEAR_MAP - 18 AUTOSCALE_AMPLITUDE - 19 AUTOSCALE_PHASE - 20 LONGITUDINAL_MODE + 18 LONGITUDINAL_MODE + 19 AUTOSCALE_AMPLITUDE + 20 AUTOSCALE_PHASE 22 CAVITY_TYPE 23 phi0_max [private] 24 PHI0 @@ -3275,6 +3320,7 @@ 59 Z_OFFSET_TOT 60 TILT_TOT 62 MULTIPASS_REF_ENERGY [private] + 63 dispatch [private] 64 REF_TIME_START 65 INTEGRATOR_ORDER 66 NUM_STEPS @@ -3402,6 +3448,7 @@ 60 ROLL_TOT 61 REF_TILT_TOT 62 MULTIPASS_REF_ENERGY [private] + 63 dispatch [private] 64 REF_TIME_START 65 INTEGRATOR_ORDER 66 NUM_STEPS @@ -3498,6 +3545,7 @@ 59 Z_OFFSET_TOT 60 TILT_TOT 62 MULTIPASS_REF_ENERGY [private] + 63 dispatch [private] 64 REF_TIME_START 65 INTEGRATOR_ORDER 66 NUM_STEPS @@ -3586,6 +3634,7 @@ 59 Z_OFFSET_TOT 60 TILT_TOT 62 MULTIPASS_REF_ENERGY [private] + 63 dispatch [private] 64 REF_TIME_START 65 INTEGRATOR_ORDER 66 NUM_STEPS @@ -3652,6 +3701,7 @@ 58 Y_OFFSET_TOT 59 Z_OFFSET_TOT 60 TILT_TOT + 63 dispatch [private] 64 REF_TIME_START 71 X1_LIMIT 72 X2_LIMIT @@ -3752,6 +3802,7 @@ 60 ROLL_TOT 61 REF_TILT_TOT 62 MULTIPASS_REF_ENERGY [private] + 63 dispatch [private] 64 REF_TIME_START 65 INTEGRATOR_ORDER 66 NUM_STEPS @@ -3845,6 +3896,7 @@ 59 Z_OFFSET_TOT 60 TILT_TOT 62 MULTIPASS_REF_ENERGY [private] + 63 dispatch [private] 64 REF_TIME_START 65 INTEGRATOR_ORDER 66 NUM_STEPS @@ -3940,6 +3992,7 @@ 59 Z_OFFSET_TOT 60 TILT_TOT 62 MULTIPASS_REF_ENERGY [private] + 63 dispatch [private] 64 REF_TIME_START 65 INTEGRATOR_ORDER 66 NUM_STEPS @@ -4035,6 +4088,7 @@ 59 Z_OFFSET_TOT 60 TILT_TOT 62 MULTIPASS_REF_ENERGY [private] + 63 dispatch [private] 64 REF_TIME_START 65 INTEGRATOR_ORDER 66 NUM_STEPS @@ -4115,6 +4169,7 @@ 58 Y_OFFSET_TOT 59 Z_OFFSET_TOT 60 TILT_TOT + 63 dispatch [private] 64 REF_TIME_START 69 LORD_PAD1 70 LORD_PAD2 @@ -4160,6 +4215,96 @@ 131 S_Position [private] 133 WRAP_SUPERIMPOSE + !--------------------------------- + 67 Thick_Multipole + 1 L + 2 TILT + 10 FRINGE_TYPE + 11 FRINGE_AT + 13 SPIN_FRINGE_ON + 17 STATIC_LINEAR_MAP + 34 X_PITCH + 35 Y_PITCH + 36 X_OFFSET + 37 Y_OFFSET + 38 Z_OFFSET + 39 HKICK + 40 VKICK + 41 BL_HKICK + 42 BL_VKICK + 47 PTC_CANONICAL_COORDS + 50 DELTA_REF_TIME + 51 p0c_start [private] + 52 e_tot_start [private] + 53 P0C + 54 E_TOT + 55 X_PITCH_TOT + 56 Y_PITCH_TOT + 57 X_OFFSET_TOT + 58 Y_OFFSET_TOT + 59 Z_OFFSET_TOT + 60 TILT_TOT + 62 MULTIPASS_REF_ENERGY [private] + 63 dispatch [private] + 64 REF_TIME_START + 65 INTEGRATOR_ORDER + 66 NUM_STEPS + 67 DS_STEP + 68 CSR_DS_STEP + 69 LORD_PAD1 + 70 LORD_PAD2 + 71 X1_LIMIT + 72 X2_LIMIT + 73 Y1_LIMIT + 74 Y2_LIMIT + 75 check_sum [private] + 82 ALIAS + 83 LR_SELF_WAKE_ON + 84 LR_WAKE_FILE + 85 LR_FREQ_SPREAD + 86 MULTIPOLES_ON + 87 APERTURE_TYPE + 88 TAYLOR_MAP_INCLUDES_OFFSETS + 89 CSR_METHOD + 90 SPACE_CHARGE_METHOD + 91 MAT6_CALC_METHOD + 92 TRACKING_METHOD + 93 PTC_INTEGRATION_TYPE + 94 SPIN_TRACKING_METHOD + 95 APERTURE + 96 X_LIMIT + 97 Y_LIMIT + 98 OFFSET_MOVES_APERTURE + 100 SR_WAKE_FILE + 103 SYMPLECTIFY + 105 IS_ON + 106 FIELD_CALC + 107 WALL + 108 APERTURE_AT + 110 FIELD_OVERLAPS + 111 FIELD_MASTER + 112 DESCRIP + 113 SCALE_MULTIPOLES + 114 SR_WAKE + 115 LR_WAKE + 117 TYPE + 118 REF_ORIGIN + 119 ELE_ORIGIN + 120 SUPERIMPOSE + 121 OFFSET + 122 REFERENCE + 123 CARTESIAN_MAP + 124 CYLINDRICAL_MAP + 125 GRID_FIELD + 126 GEN_GRAD_MAP + 127 CREATE_JUMBO_SLAVE + 128 Accordion_Edge [private] + 129 Start_Edge [private] + 130 End_Edge [private] + 131 S_Position [private] + 133 WRAP_SUPERIMPOSE + 140 A0 + !--------------------------------- 51 Undulator 1 L @@ -4201,6 +4346,7 @@ 59 Z_OFFSET_TOT 60 TILT_TOT 62 MULTIPASS_REF_ENERGY [private] + 63 dispatch [private] 64 REF_TIME_START 65 INTEGRATOR_ORDER 66 NUM_STEPS @@ -4289,6 +4435,7 @@ 59 Z_OFFSET_TOT 60 TILT_TOT 62 MULTIPASS_REF_ENERGY [private] + 63 dispatch [private] 64 REF_TIME_START 65 INTEGRATOR_ORDER 66 NUM_STEPS @@ -4389,6 +4536,7 @@ 59 Z_OFFSET_TOT 60 TILT_TOT 62 MULTIPASS_REF_ENERGY [private] + 63 dispatch [private] 64 REF_TIME_START 65 INTEGRATOR_ORDER 66 NUM_STEPS @@ -4452,31 +4600,31 @@ !--------------------------------- Index usage: Ix Count - 1 56 - 2 54 - 3 22 - 4 21 - 5 25 - 6 25 - 7 22 - 8 29 - 9 16 - 10 29 - 11 31 + 1 57 + 2 55 + 3 23 + 4 22 + 5 29 + 6 26 + 7 23 + 8 30 + 9 17 + 10 30 + 11 32 12 3 - 13 29 + 13 30 14 6 15 22 16 23 - 17 30 - 18 7 + 17 31 + 18 5 19 12 - 20 19 - 21 19 - 22 20 - 23 19 + 20 20 + 21 21 + 22 21 + 23 20 24 23 - 25 18 + 25 19 26 27 27 18 28 22 @@ -4485,113 +4633,113 @@ 31 19 32 11 33 11 - 34 48 - 35 48 - 36 50 - 37 50 - 38 50 - 39 26 - 40 27 - 41 25 - 42 22 + 34 49 + 35 49 + 36 51 + 37 51 + 38 51 + 39 27 + 40 28 + 41 26 + 42 23 43 10 44 8 - 45 8 - 46 8 + 45 7 + 46 7 47 20 48 5 49 7 - 50 55 - 51 55 - 52 55 - 53 57 - 54 57 - 55 45 - 56 44 - 57 46 - 58 46 - 59 46 - 60 46 + 50 56 + 51 56 + 52 56 + 53 58 + 54 58 + 55 46 + 56 45 + 57 47 + 58 47 + 59 47 + 60 47 61 7 - 62 28 - 63 0 - 64 55 - 65 30 - 66 28 - 67 28 - 68 29 - 69 29 - 70 35 - 71 52 - 72 52 - 73 52 - 74 52 - 75 60 + 62 29 + 63 46 + 64 56 + 65 31 + 66 29 + 67 29 + 68 30 + 69 30 + 70 36 + 71 53 + 72 53 + 73 53 + 74 53 + 75 61 76 0 77 0 78 0 79 0 80 0 81 11 - 82 61 - 83 35 - 84 39 - 85 36 - 86 25 - 87 55 - 88 31 - 89 39 - 90 36 - 91 53 - 92 55 - 93 55 - 94 53 - 95 52 - 96 53 - 97 52 - 98 52 + 82 62 + 83 36 + 84 40 + 85 37 + 86 26 + 87 56 + 88 32 + 89 40 + 90 37 + 91 54 + 92 56 + 93 56 + 94 54 + 95 53 + 96 54 + 97 53 + 98 53 99 5 - 100 32 + 100 33 101 10 102 4 - 103 33 + 103 34 104 3 - 105 46 - 106 32 - 107 49 - 108 54 + 105 48 + 106 33 + 107 50 + 108 55 109 6 - 110 28 - 111 22 - 112 58 - 113 14 - 114 27 - 115 28 + 110 29 + 111 23 + 112 59 + 113 15 + 114 28 + 115 29 116 6 - 117 58 - 118 54 - 119 54 - 120 54 - 121 54 - 122 54 - 123 19 - 124 19 - 125 20 - 126 19 - 127 52 - 128 39 - 129 39 - 130 39 - 131 39 + 117 59 + 118 55 + 119 55 + 120 55 + 121 55 + 122 55 + 123 20 + 124 20 + 125 21 + 126 20 + 127 53 + 128 40 + 129 40 + 130 40 + 131 40 132 6 - 133 54 + 133 55 134 0 135 0 136 0 137 0 138 0 139 0 - 140 23 + 140 24 141 0 142 0 143 0 @@ -4784,6 +4932,7 @@ Index: 1 Crab_Cavity RF_Bend Foil + Thick_Multipole !--------------------------------- Index: 2 @@ -4841,6 +4990,7 @@ Index: 2 Crab_Cavity RF_Bend Foil + Thick_Multipole !--------------------------------- Index: 3 @@ -4866,6 +5016,7 @@ Index: 3 Detector Lens RF_Bend + Foil !--------------------------------- Index: 4 @@ -4890,11 +5041,13 @@ Index: 4 Detector Crab_Cavity RF_Bend + Foil !--------------------------------- Index: 5 Sbend Sextupole + RFcavity BeamBeam Wiggler Sol_Quad @@ -4918,6 +5071,9 @@ Index: 5 Detector Sad_Mult Lens + Crab_Cavity + RF_Bend + Foil !--------------------------------- Index: 6 @@ -4946,6 +5102,7 @@ Index: 6 Mask Crab_Cavity RF_Bend + Foil !--------------------------------- Index: 7 @@ -4971,6 +5128,7 @@ Index: 7 Undulator Detector RF_Bend + Foil !--------------------------------- Index: 8 @@ -5003,6 +5161,7 @@ Index: 8 AC_Kicker Crab_Cavity Ramper + Foil !--------------------------------- Index: 9 @@ -5022,6 +5181,7 @@ Index: 9 Undulator Sad_Mult RF_Bend + Foil !--------------------------------- Index: 10 @@ -5054,6 +5214,7 @@ Index: 10 Sad_Mult AC_Kicker RF_Bend + Thick_Multipole !--------------------------------- Index: 11 @@ -5088,6 +5249,7 @@ Index: 11 Sad_Mult AC_Kicker RF_Bend + Thick_Multipole !--------------------------------- Index: 12 @@ -5126,6 +5288,7 @@ Index: 13 Sad_Mult AC_Kicker RF_Bend + Thick_Multipole !--------------------------------- Index: 14 @@ -5219,16 +5382,15 @@ Index: 17 AC_Kicker Crab_Cavity RF_Bend + Thick_Multipole !--------------------------------- Index: 18 RFcavity Lcavity Match - E_Gun EM_Field Photon_Init - Crab_Cavity !--------------------------------- Index: 19 @@ -5259,13 +5421,14 @@ Index: 20 Match Monitor Instrument - !Particle_Start Pipe Multilayer_Mirror + E_Gun EM_Field Photon_Init Detector Sad_Mult + Crab_Cavity !--------------------------------- Index: 21 @@ -5284,10 +5447,12 @@ Index: 21 Crystal Pipe Multilayer_Mirror + EM_Field Undulator Photon_Init Detector Sad_Mult + Foil !--------------------------------- Index: 22 @@ -5311,6 +5476,7 @@ Index: 22 Photon_Init Detector Sad_Mult + Foil !--------------------------------- Index: 23 @@ -5333,6 +5499,7 @@ Index: 23 Photon_Init Detector Sad_Mult + Foil !--------------------------------- Index: 24 @@ -5349,7 +5516,6 @@ Index: 24 Instrument Rcollimator Ecollimator - !Particle_Start Crystal Pipe E_Gun @@ -5359,6 +5525,7 @@ Index: 24 Sad_Mult Crab_Cavity RF_Bend + Foil !--------------------------------- Index: 25 @@ -5380,6 +5547,7 @@ Index: 25 EM_Field Photon_Init Detector + Foil !--------------------------------- Index: 26 @@ -5612,6 +5780,7 @@ Index: 34 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 35 @@ -5663,6 +5832,7 @@ Index: 35 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 36 @@ -5716,6 +5886,7 @@ Index: 36 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 37 @@ -5769,6 +5940,7 @@ Index: 37 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 38 @@ -5822,6 +5994,7 @@ Index: 38 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 39 @@ -5851,6 +6024,7 @@ Index: 39 AC_Kicker Crab_Cavity RF_Bend + Thick_Multipole !--------------------------------- Index: 40 @@ -5881,6 +6055,7 @@ Index: 40 AC_Kicker Crab_Cavity RF_Bend + Thick_Multipole !--------------------------------- Index: 41 @@ -5909,6 +6084,7 @@ Index: 41 AC_Kicker Crab_Cavity RF_Bend + Thick_Multipole !--------------------------------- Index: 42 @@ -5934,6 +6110,7 @@ Index: 42 AC_Kicker Crab_Cavity RF_Bend + Thick_Multipole !--------------------------------- Index: 43 @@ -5968,7 +6145,6 @@ Index: 45 Rbend Lcavity !Parameter - Match !--------------------------------- Index: 46 @@ -5979,7 +6155,6 @@ Index: 46 Lcavity !Parameter !Line - Match !--------------------------------- Index: 47 @@ -5998,11 +6173,11 @@ Index: 47 Lcavity !Parameter !Line - Match HKicker VKicker EM_Field Undulator + Thick_Multipole !--------------------------------- Index: 48 @@ -6079,6 +6254,7 @@ Index: 50 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 51 @@ -6137,6 +6313,7 @@ Index: 51 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 52 @@ -6195,6 +6372,7 @@ Index: 52 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 53 @@ -6255,6 +6433,7 @@ Index: 53 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 54 @@ -6315,6 +6494,7 @@ Index: 54 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 55 @@ -6363,6 +6543,7 @@ Index: 55 Crab_Cavity RF_Bend Foil + Thick_Multipole !--------------------------------- Index: 56 @@ -6410,6 +6591,7 @@ Index: 56 Crab_Cavity RF_Bend Foil + Thick_Multipole !--------------------------------- Index: 57 @@ -6459,6 +6641,7 @@ Index: 57 Crab_Cavity RF_Bend Foil + Thick_Multipole !--------------------------------- Index: 58 @@ -6508,6 +6691,7 @@ Index: 58 Crab_Cavity RF_Bend Foil + Thick_Multipole !--------------------------------- Index: 59 @@ -6557,6 +6741,7 @@ Index: 59 Crab_Cavity RF_Bend Foil + Thick_Multipole !--------------------------------- Index: 60 @@ -6606,6 +6791,7 @@ Index: 60 Crab_Cavity RF_Bend Foil + Thick_Multipole !--------------------------------- Index: 61 @@ -6647,9 +6833,56 @@ Index: 62 AC_Kicker Crab_Cavity RF_Bend + Thick_Multipole !--------------------------------- Index: 63 + Drift + Sbend + Quadrupole + Sextupole + Custom + Taylor + RFcavity + ELseparator + BeamBeam + Wiggler + Sol_Quad + Marker + Kicker + Octupole + Rbend + Multipole + AB_multipole + Solenoid + Lcavity + Monitor + Instrument + HKicker + VKicker + Rcollimator + Ecollimator + Converter + Mirror + Crystal + Pipe + Capillary + Multilayer_Mirror + E_Gun + EM_Field + Undulator + Diffraction_Plate + Photon_Init + Sample + Detector + Sad_Mult + Mask + AC_Kicker + Lens + Crab_Cavity + RF_Bend + Foil + Thick_Multipole !--------------------------------- Index: 64 @@ -6708,6 +6941,7 @@ Index: 64 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 65 @@ -6741,6 +6975,7 @@ Index: 65 Crab_Cavity RF_Bend Foil + Thick_Multipole !--------------------------------- Index: 66 @@ -6772,6 +7007,7 @@ Index: 66 AC_Kicker Crab_Cavity RF_Bend + Thick_Multipole !--------------------------------- Index: 67 @@ -6803,6 +7039,7 @@ Index: 67 AC_Kicker Crab_Cavity RF_Bend + Thick_Multipole !--------------------------------- Index: 68 @@ -6835,6 +7072,7 @@ Index: 68 AC_Kicker Crab_Cavity RF_Bend + Thick_Multipole !--------------------------------- Index: 69 @@ -6867,6 +7105,7 @@ Index: 69 AC_Kicker Crab_Cavity RF_Bend + Thick_Multipole !--------------------------------- Index: 70 @@ -6905,6 +7144,7 @@ Index: 70 AC_Kicker Crab_Cavity RF_Bend + Thick_Multipole !--------------------------------- Index: 71 @@ -6960,6 +7200,7 @@ Index: 71 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 72 @@ -7015,6 +7256,7 @@ Index: 72 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 73 @@ -7070,6 +7312,7 @@ Index: 73 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 74 @@ -7125,6 +7368,7 @@ Index: 74 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 75 @@ -7188,6 +7432,7 @@ Index: 75 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 76 @@ -7281,6 +7526,7 @@ Index: 82 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 83 @@ -7319,6 +7565,7 @@ Index: 83 Crab_Cavity Ramper RF_Bend + Thick_Multipole !--------------------------------- Index: 84 @@ -7361,6 +7608,7 @@ Index: 84 Crab_Cavity Ramper RF_Bend + Thick_Multipole !--------------------------------- Index: 85 @@ -7400,6 +7648,7 @@ Index: 85 AC_Kicker Crab_Cavity RF_Bend + Thick_Multipole !--------------------------------- Index: 86 @@ -7428,6 +7677,7 @@ Index: 86 Sample Detector AC_Kicker + Thick_Multipole !--------------------------------- Index: 87 @@ -7486,6 +7736,7 @@ Index: 87 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 88 @@ -7520,6 +7771,7 @@ Index: 88 AC_Kicker Crab_Cavity RF_Bend + Thick_Multipole !--------------------------------- Index: 89 @@ -7562,6 +7814,7 @@ Index: 89 Crab_Cavity Ramper RF_Bend + Thick_Multipole !--------------------------------- Index: 90 @@ -7601,6 +7854,7 @@ Index: 90 AC_Kicker Crab_Cavity RF_Bend + Thick_Multipole !--------------------------------- Index: 91 @@ -7657,6 +7911,7 @@ Index: 91 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 92 @@ -7715,6 +7970,7 @@ Index: 92 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 93 @@ -7773,6 +8029,7 @@ Index: 93 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 94 @@ -7829,6 +8086,7 @@ Index: 94 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 95 @@ -7884,6 +8142,7 @@ Index: 95 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 96 @@ -7940,6 +8199,7 @@ Index: 96 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 97 @@ -7995,6 +8255,7 @@ Index: 97 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 98 @@ -8050,6 +8311,7 @@ Index: 98 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 99 @@ -8093,6 +8355,7 @@ Index: 100 Crab_Cavity !PTC_Com RF_Bend + Thick_Multipole !--------------------------------- Index: 101 @@ -8149,6 +8412,7 @@ Index: 103 AC_Kicker Crab_Cavity RF_Bend + Thick_Multipole !--------------------------------- Index: 104 @@ -8160,6 +8424,7 @@ Index: 104 Index: 105 Sbend Quadrupole + Group Sextupole Overlay Custom @@ -8204,6 +8469,7 @@ Index: 105 !PTC_Com RF_Bend Foil + Thick_Multipole !--------------------------------- Index: 106 @@ -8239,6 +8505,7 @@ Index: 106 AC_Kicker Crab_Cavity RF_Bend + Thick_Multipole !--------------------------------- Index: 107 @@ -8291,6 +8558,7 @@ Index: 107 Crab_Cavity RF_Bend Foil + Thick_Multipole !--------------------------------- Index: 108 @@ -8348,6 +8616,7 @@ Index: 108 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 109 @@ -8388,6 +8657,7 @@ Index: 110 AC_Kicker Crab_Cavity RF_Bend + Thick_Multipole !--------------------------------- Index: 111 @@ -8413,6 +8683,7 @@ Index: 111 AC_Kicker Crab_Cavity RF_Bend + Thick_Multipole !--------------------------------- Index: 112 @@ -8474,6 +8745,7 @@ Index: 112 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 113 @@ -8491,6 +8763,7 @@ Index: 113 VKicker Undulator AC_Kicker + Thick_Multipole !--------------------------------- Index: 114 @@ -8521,6 +8794,7 @@ Index: 114 AC_Kicker Crab_Cavity RF_Bend + Thick_Multipole !--------------------------------- Index: 115 @@ -8552,6 +8826,7 @@ Index: 115 AC_Kicker Crab_Cavity RF_Bend + Thick_Multipole !--------------------------------- Index: 116 @@ -8622,6 +8897,7 @@ Index: 117 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 118 @@ -8679,6 +8955,7 @@ Index: 118 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 119 @@ -8736,6 +9013,7 @@ Index: 119 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 120 @@ -8793,6 +9071,7 @@ Index: 120 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 121 @@ -8850,6 +9129,7 @@ Index: 121 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 122 @@ -8907,6 +9187,7 @@ Index: 122 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 123 @@ -8929,6 +9210,7 @@ Index: 123 Undulator AC_Kicker Crab_Cavity + Thick_Multipole !--------------------------------- Index: 124 @@ -8951,6 +9233,7 @@ Index: 124 Undulator AC_Kicker Crab_Cavity + Thick_Multipole !--------------------------------- Index: 125 @@ -8974,6 +9257,7 @@ Index: 125 AC_Kicker Crab_Cavity RF_Bend + Thick_Multipole !--------------------------------- Index: 126 @@ -8996,6 +9280,7 @@ Index: 126 Undulator AC_Kicker Crab_Cavity + Thick_Multipole !--------------------------------- Index: 127 @@ -9051,6 +9336,7 @@ Index: 127 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 128 @@ -9093,6 +9379,7 @@ Index: 128 Crab_Cavity RF_Bend Foil + Thick_Multipole !--------------------------------- Index: 129 @@ -9135,6 +9422,7 @@ Index: 129 Crab_Cavity RF_Bend Foil + Thick_Multipole !--------------------------------- Index: 130 @@ -9177,6 +9465,7 @@ Index: 130 Crab_Cavity RF_Bend Foil + Thick_Multipole !--------------------------------- Index: 131 @@ -9219,6 +9508,7 @@ Index: 131 Crab_Cavity RF_Bend Foil + Thick_Multipole !--------------------------------- Index: 132 @@ -9285,6 +9575,7 @@ Index: 133 RF_Bend GKicker Foil + Thick_Multipole !--------------------------------- Index: 134 @@ -9329,3 +9620,4 @@ Index: 140 Detector Sad_Mult AC_Kicker + Thick_Multipole diff --git a/util_programs/element_attributes/list-element-attributes.tex b/util_programs/element_attributes/list-element-attributes.tex index 3c9daf6f83..ad81e4907b 100644 --- a/util_programs/element_attributes/list-element-attributes.tex +++ b/util_programs/element_attributes/list-element-attributes.tex @@ -43,7 +43,7 @@ \chapter{List of Element Attributes} delta_ref_time [sec] & p0c [eV] & wall & y_offset_tot [m] \\ descrip & ptc_integration_type & wrap_superimpose & z_offset [m] \\ e_tot [eV] & ref_origin & x1_limit [m] & z_offset_tot [m] \\ -ele_origin & ref_time_start [???] & x2_limit [m] & \\ +ele_origin & ref_time_start [sec] & x2_limit [m] & \\ field_master & reference & x_limit [m] & \\ \bottomrule \end{tabular} @@ -60,7 +60,7 @@ \chapter{List of Element Attributes} aperture [m] & gen_grad_map & r0_elec [m] & wall \\ aperture_at & grid_field & r0_mag [m] & wrap_superimpose \\ aperture_type & hkick & ref_origin & x1_limit [m] \\ -bl_hkick [T*m] & integrator_order & ref_time_start [???] & x2_limit [m] \\ +bl_hkick [T*m] & integrator_order & ref_time_start [sec] & x2_limit [m] \\ bl_vkick [T*m] & interpolation & reference & x_limit [m] \\ cartesian_map & is_on & scale_multipoles & x_offset [m] \\ create_jumbo_slave & l [m] & space_charge_method & x_offset_tot [m] \\ @@ -87,7 +87,7 @@ \chapter{List of Element Attributes} alias & crab_x3 [1/m$^2$] & p0c [eV] & wrap_superimpose \\ alpha_a_strong & crab_x4 [1/m$^3$] & ptc_integration_type & x1_limit [m] \\ alpha_b_strong & crab_x5 [1/m$^4$] & ref_origin & x2_limit [m] \\ -aperture [m] & create_jumbo_slave & ref_time_start [???] & x_limit [m] \\ +aperture [m] & create_jumbo_slave & ref_time_start [sec] & x_limit [m] \\ aperture_at & delta_ref_time [sec] & reference & x_offset [m] \\ aperture_type & descrip & repetition_frequency [Hz] & x_offset_tot [m] \\ bbi_constant & e_tot [eV] & sig_x [m] & x_pitch [rad] \\ @@ -145,7 +145,7 @@ \chapter{List of Element Attributes} csr_ds_step [m] & hgapx [m] & ref_origin & x_offset_tot [m] \\ csr_method & hkick & ref_tilt [rad] & x_pitch [rad] \\ cylindrical_map & integrator_order & ref_tilt_tot [rad] & x_pitch_tot [rad] \\ -db_field [T] & is_on & ref_time_start [???] & y1_limit [m] \\ +db_field [T] & is_on & ref_time_start [sec] & y1_limit [m] \\ delta_ref_time [sec] & k1 [1/m$^2$] & reference & y2_limit [m] \\ descrip & k2 [1/m$^3$] & rho [m] & y_limit [m] \\ dg [1/m] & l [m] & roll [rad] & y_offset [m] \\ @@ -180,7 +180,7 @@ \chapter{List of Element Attributes} create_jumbo_slave & p0c [eV] & wall & y_limit [m] \\ critical_angle_factor [rad*eV] & ptc_integration_type & wrap_superimpose & y_offset [m] \\ delta_ref_time [sec] & ref_origin & x1_limit [m] & y_offset_tot [m] \\ -descrip & ref_time_start [???] & x2_limit [m] & y_pitch [rad] \\ +descrip & ref_time_start [sec] & x2_limit [m] & y_pitch [rad] \\ e_tot [eV] & reference & x_limit [m] & y_pitch_tot [rad] \\ ele_origin & spin_tracking_method & x_offset [m] & z_offset [m] \\ l [m] & superimpose & x_offset_tot [m] & z_offset_tot [m] \\ @@ -194,7 +194,7 @@ \chapter{List of Element Attributes} \begin{tabular}{llll} \toprule alias & is_on & ref_origin & x2_limit [m] \\ -aperture [m] & l [m] & ref_time_start [???] & x_limit [m] \\ +aperture [m] & l [m] & ref_time_start [sec] & x_limit [m] \\ aperture_at & lord_pad1 [m] & reference & x_offset [m] \\ aperture_type & lord_pad2 [m] & space_charge_method & x_offset_tot [m] \\ bl_hkick [T*m] & lr_freq_spread [Hz] & spin_fringe_on & x_pitch [rad] \\ @@ -232,7 +232,7 @@ \chapter{List of Element Attributes} descrip & pc_out_min [eV] & wrap_superimpose & y_pitch [rad] \\ distribution & ptc_integration_type & x1_limit [m] & y_pitch_tot [rad] \\ e_tot [eV] & ref_origin & x2_limit [m] & z_offset [m] \\ -e_tot_start [eV] & ref_time_start [???] & x_limit [m] & z_offset_tot [m] \\ +e_tot_start [eV] & ref_time_start [sec] & x_limit [m] & z_offset_tot [m] \\ ele_origin & reference & x_offset [m] & \\ is_on & species_out & x_offset_tot [m] & \\ \bottomrule @@ -244,26 +244,26 @@ \chapter{List of Element Attributes} \label{s:list.crab.cavity} \begin{tabular}{llll} \toprule -alias & gradient [eV/m] & ptc_integration_type & wall \\ -aperture [m] & grid_field & ref_origin & wrap_superimpose \\ -aperture_at & harmon & ref_time_start [???] & x1_limit [m] \\ -aperture_type & hkick & reference & x2_limit [m] \\ -bl_hkick [T*m] & integrator_order & rf_frequency [Hz] & x_limit [m] \\ -bl_vkick [T*m] & is_on & rf_wavelength [m] & x_offset [m] \\ -cartesian_map & l [m] & space_charge_method & x_offset_tot [m] \\ -create_jumbo_slave & lord_pad1 [m] & spin_tracking_method & x_pitch [rad] \\ -csr_ds_step [m] & lord_pad2 [m] & sr_wake & x_pitch_tot [rad] \\ -csr_method & lr_freq_spread [Hz] & sr_wake_file & y1_limit [m] \\ -cylindrical_map & lr_self_wake_on & static_linear_map & y2_limit [m] \\ -delta_ref_time [sec] & lr_wake & superimpose & y_limit [m] \\ -descrip & lr_wake_file & symplectify & y_offset [m] \\ -ds_step [m] & mat6_calc_method & taylor_map_includes_offsets & y_offset_tot [m] \\ -e_tot [eV] & num_steps & tilt [rad] & y_pitch [rad] \\ -ele_origin & offset [m] & tilt_tot [rad] & y_pitch_tot [rad] \\ -field_calc & offset_moves_aperture & tracking_method & z_offset [m] \\ -field_master & p0c [eV] & type & z_offset_tot [m] \\ -field_overlaps & phi0 [rad/2pi] & vkick & \\ -gen_grad_map & phi0_multipass [rad/2pi] & voltage [Volt] & \\ +alias & gradient [eV/m] & phi0_multipass [rad/2pi] & voltage [Volt] \\ +aperture [m] & grid_field & ptc_integration_type & wall \\ +aperture_at & harmon & ref_origin & wrap_superimpose \\ +aperture_type & harmon_master & ref_time_start [sec] & x1_limit [m] \\ +bl_hkick [T*m] & hkick & reference & x2_limit [m] \\ +bl_vkick [T*m] & integrator_order & rf_frequency [Hz] & x_limit [m] \\ +cartesian_map & is_on & rf_wavelength [m] & x_offset [m] \\ +create_jumbo_slave & l [m] & space_charge_method & x_offset_tot [m] \\ +csr_ds_step [m] & lord_pad1 [m] & spin_tracking_method & x_pitch [rad] \\ +csr_method & lord_pad2 [m] & sr_wake & x_pitch_tot [rad] \\ +cylindrical_map & lr_freq_spread [Hz] & sr_wake_file & y1_limit [m] \\ +delta_ref_time [sec] & lr_self_wake_on & static_linear_map & y2_limit [m] \\ +descrip & lr_wake & superimpose & y_limit [m] \\ +ds_step [m] & lr_wake_file & symplectify & y_offset [m] \\ +e_tot [eV] & mat6_calc_method & taylor_map_includes_offsets & y_offset_tot [m] \\ +ele_origin & num_steps & tilt [rad] & y_pitch [rad] \\ +field_calc & offset [m] & tilt_tot [rad] & y_pitch_tot [rad] \\ +field_master & offset_moves_aperture & tracking_method & z_offset [m] \\ +field_overlaps & p0c [eV] & type & z_offset_tot [m] \\ +gen_grad_map & phi0 [rad/2pi] & vkick & \\ \bottomrule \end{tabular} \vfill @@ -278,10 +278,10 @@ \chapter{List of Element Attributes} aperture [m] & elliptical_curvature_y [1/m] & ref_origin & x1_limit [m] \\ aperture_at & elliptical_curvature_z [1/m] & ref_tilt [rad] & x2_limit [m] \\ aperture_type & graze_angle_in [rad] & ref_tilt_tot [rad] & x_limit [m] \\ -b_param & graze_angle_out [rad] & ref_time_start [???] & x_offset [m] \\ +b_param & graze_angle_out [rad] & ref_time_start [sec] & x_offset [m] \\ bragg_angle [rad] & h_misalign & ref_wavelength [m] & x_offset_tot [m] \\ bragg_angle_in [rad] & is_mosaic & reference & x_pitch [rad] \\ -bragg_angle_out [rad] & l [m] & reflectivity_table [???] & x_pitch_tot [rad] \\ +bragg_angle_out [rad] & l [m] & reflectivity_table & x_pitch_tot [rad] \\ create_jumbo_slave & mat6_calc_method & segmented & y1_limit [m] \\ crystal_type & mosaic_angle_rms_in_plane [rad] & spherical_curvature [1/m] & y2_limit [m] \\ curvature & mosaic_angle_rms_out_plane [rad] & spin_tracking_method & y_limit [m] \\ @@ -317,7 +317,7 @@ \chapter{List of Element Attributes} e_tot [eV] & p0c_start [eV] & val12 & y_limit [m] \\ e_tot_start [eV] & ptc_integration_type & val2 & y_offset [m] \\ ele_origin & ref_origin & val3 & y_offset_tot [m] \\ -field_calc & ref_time_start [???] & val4 & y_pitch [rad] \\ +field_calc & ref_time_start [sec] & val4 & y_pitch [rad] \\ field_master & reference & val5 & y_pitch_tot [rad] \\ field_overlaps & space_charge_method & val6 & z_offset [m] \\ integrator_order & spin_tracking_method & val7 & z_offset_tot [m] \\ @@ -344,7 +344,7 @@ \chapter{List of Element Attributes} de_eta_meas & pixel & x_dispersion_calib [m] & y_offset_calib [m] \\ delta_ref_time [sec] & ptc_integration_type & x_dispersion_err [m] & y_offset_tot [m] \\ descrip & ref_origin & x_gain_calib [m] & y_pitch [rad] \\ -displacement & ref_time_start [???] & x_gain_err [m] & y_pitch_tot [rad] \\ +displacement & ref_time_start [sec] & x_gain_err [m] & y_pitch_tot [rad] \\ e_tot [eV] & reference & x_limit [m] & z_offset [m] \\ ele_origin & segmented & x_offset [m] & z_offset_tot [m] \\ elliptical_curvature_x [1/m] & spherical_curvature [1/m] & x_offset_calib [m] & \\ @@ -369,7 +369,7 @@ \chapter{List of Element Attributes} delta_ref_time [sec] & p0c [eV] & wall & y_pitch [rad] \\ descrip & ptc_integration_type & wrap_superimpose & y_pitch_tot [rad] \\ displacement & ref_origin & x1_limit [m] & z_offset [m] \\ -e_tot [eV] & ref_time_start [???] & x2_limit [m] & z_offset_tot [m] \\ +e_tot [eV] & ref_time_start [sec] & x2_limit [m] & z_offset_tot [m] \\ ele_origin & ref_wavelength [m] & x_limit [m] & \\ elliptical_curvature_x [1/m] & reference & x_offset [m] & \\ elliptical_curvature_y [1/m] & segmented & x_offset_tot [m] & \\ @@ -392,7 +392,7 @@ \chapter{List of Element Attributes} delta_ref_time [sec] & p0c [eV] & type & y_offset_tot [m] \\ descrip & ptc_integration_type & wall & y_pitch [rad] \\ ds_step [m] & ref_origin & wrap_superimpose & y_pitch_tot [rad] \\ -e_tot [eV] & ref_time_start [???] & x1_limit [m] & z_offset [m] \\ +e_tot [eV] & ref_time_start [sec] & x1_limit [m] & z_offset [m] \\ ele_origin & reference & x2_limit [m] & z_offset_tot [m] \\ field_calc & space_charge_method & x_limit [m] & \\ integrator_order & spin_tracking_method & x_offset [m] & \\ @@ -408,7 +408,7 @@ \chapter{List of Element Attributes} a0 - a20, b0 - b20 & gap & r0_elec [m] & wall \\ alias & gen_grad_map & r0_mag [m] & wrap_superimpose \\ aperture [m] & grid_field & ref_origin & x1_limit [m] \\ -aperture_at & hkick & ref_time_start [???] & x2_limit [m] \\ +aperture_at & hkick & ref_time_start [sec] & x2_limit [m] \\ aperture_type & integrator_order & reference & x_limit [m] \\ cartesian_map & is_on & scale_multipoles & x_offset [m] \\ create_jumbo_slave & l [m] & space_charge_method & x_offset_tot [m] \\ @@ -435,27 +435,27 @@ \chapter{List of Element Attributes} \label{s:list.em.field} \begin{tabular}{llll} \toprule -alias & fringe_at & phi0_err [rad/2pi] & wall \\ -aperture [m] & fringe_type & ptc_canonical_coords & wrap_superimpose \\ -aperture_at & gen_grad_map & ptc_integration_type & x1_limit [m] \\ -aperture_type & grid_field & ref_origin & x2_limit [m] \\ -autoscale_amplitude & integrator_order & ref_time_start [???] & x_limit [m] \\ -autoscale_phase & is_on & reference & x_offset [m] \\ -cartesian_map & l [m] & rf_frequency [Hz] & x_offset_tot [m] \\ -constant_ref_energy & lord_pad1 [m] & rf_wavelength [m] & x_pitch [rad] \\ -create_jumbo_slave & lord_pad2 [m] & space_charge_method & x_pitch_tot [rad] \\ -csr_ds_step [m] & lr_freq_spread [Hz] & spin_fringe_on & y1_limit [m] \\ -csr_method & lr_self_wake_on & spin_tracking_method & y2_limit [m] \\ -cylindrical_map & lr_wake & sr_wake & y_limit [m] \\ -delta_ref_time [sec] & lr_wake_file & sr_wake_file & y_offset [m] \\ -descrip & mat6_calc_method & static_linear_map & y_offset_tot [m] \\ -ds_step [m] & num_steps & superimpose & y_pitch [rad] \\ -e_tot [eV] & offset [m] & symplectify & y_pitch_tot [rad] \\ -e_tot_start [eV] & offset_moves_aperture & taylor_map_includes_offsets & z_offset [m] \\ -ele_origin & p0c [eV] & tilt [rad] & z_offset_tot [m] \\ -field_autoscale & p0c_start [eV] & tilt_tot [rad] & \\ -field_calc & phi0 [rad/2pi] & tracking_method & \\ -field_overlaps & phi0_autoscale [rad/2pi] & type & \\ +alias & fringe_at & phi0_err [rad/2pi] & type \\ +aperture [m] & fringe_type & polarity & wall \\ +aperture_at & gen_grad_map & ptc_canonical_coords & wrap_superimpose \\ +aperture_type & grid_field & ptc_integration_type & x1_limit [m] \\ +autoscale_amplitude & integrator_order & ref_origin & x2_limit [m] \\ +autoscale_phase & is_on & ref_time_start [sec] & x_limit [m] \\ +cartesian_map & l [m] & reference & x_offset [m] \\ +constant_ref_energy & lord_pad1 [m] & rf_frequency [Hz] & x_offset_tot [m] \\ +create_jumbo_slave & lord_pad2 [m] & rf_wavelength [m] & x_pitch [rad] \\ +csr_ds_step [m] & lr_freq_spread [Hz] & space_charge_method & x_pitch_tot [rad] \\ +csr_method & lr_self_wake_on & spin_fringe_on & y1_limit [m] \\ +cylindrical_map & lr_wake & spin_tracking_method & y2_limit [m] \\ +delta_ref_time [sec] & lr_wake_file & sr_wake & y_limit [m] \\ +descrip & mat6_calc_method & sr_wake_file & y_offset [m] \\ +ds_step [m] & num_steps & static_linear_map & y_offset_tot [m] \\ +e_tot [eV] & offset [m] & superimpose & y_pitch [rad] \\ +e_tot_start [eV] & offset_moves_aperture & symplectify & y_pitch_tot [rad] \\ +ele_origin & p0c [eV] & taylor_map_includes_offsets & z_offset [m] \\ +field_autoscale & p0c_start [eV] & tilt [rad] & z_offset_tot [m] \\ +field_calc & phi0 [rad/2pi] & tilt_tot [rad] & \\ +field_overlaps & phi0_autoscale [rad/2pi] & tracking_method & \\ \bottomrule \end{tabular} \vfill @@ -468,7 +468,7 @@ \chapter{List of Element Attributes} alias & fringe_type & phi0_err [rad/2pi] & voltage_tot [Volt] \\ aperture [m] & gen_grad_map & ptc_integration_type & wall \\ aperture_at & gradient [eV/m] & ref_origin & wrap_superimpose \\ -aperture_type & gradient_err [eV/m] & ref_time_start [???] & x1_limit [m] \\ +aperture_type & gradient_err [eV/m] & ref_time_start [sec] & x1_limit [m] \\ autoscale_amplitude & gradient_tot [eV/m] & reference & x2_limit [m] \\ autoscale_phase & grid_field & rf_frequency [Hz] & x_limit [m] \\ cartesian_map & integrator_order & rf_wavelength [m] & x_offset [m] \\ @@ -501,7 +501,7 @@ \chapter{List of Element Attributes} descrip & e_tot [eV] & p0c [eV] & tracking_method \\ dphi_origin [rad] & ele_origin & ptc_integration_type & type \\ dpsi_origin [rad] & l [m] & ref_origin & wrap_superimpose \\ -dtheta_origin [rad] & mat6_calc_method & ref_time_start [???] & \\ +dtheta_origin [rad] & mat6_calc_method & ref_time_start [sec] & \\ dx_origin [m] & offset [m] & reference & \\ \bottomrule \end{tabular} @@ -521,7 +521,7 @@ \chapter{List of Element Attributes} descrip & p0c [eV] & upstream_ele_dir & y_limit [m] \\ downstream_ele_dir & ptc_integration_type & wall & y_offset [m] \\ e_tot [eV] & ref_origin & wrap_superimpose & y_pitch [rad] \\ -ele_origin & ref_time_start [???] & x1_limit [m] & z_offset [m] \\ +ele_origin & ref_time_start [sec] & x1_limit [m] & z_offset [m] \\ \bottomrule \end{tabular} \vfill @@ -531,18 +531,21 @@ \chapter{List of Element Attributes} \label{s:list.foil} \begin{tabular}{llll} \toprule -alias & material_type & tilt_tot [rad] & y1_limit [m] \\ -aperture [m] & offset [m] & tracking_method & y2_limit [m] \\ -aperture_at & offset_moves_aperture & type & y_limit [m] \\ -aperture_type & p0c [eV] & wall & y_offset [m] \\ -create_jumbo_slave & ptc_integration_type & wrap_superimpose & y_offset_tot [m] \\ -delta_ref_time [sec] & ref_origin & x1_limit [m] & y_pitch [rad] \\ -descrip & ref_time_start [???] & x2_limit [m] & y_pitch_tot [rad] \\ -e_tot [eV] & reference & x_limit [m] & z_offset [m] \\ -ele_origin & spin_tracking_method & x_offset [m] & z_offset_tot [m] \\ -is_on & superimpose & x_offset_tot [m] & \\ -l [m] & thickness [m] & x_pitch [rad] & \\ -mat6_calc_method & tilt [rad] & x_pitch_tot [rad] & \\ +alias & l [m] & thickness [m] & x_pitch_tot [rad] \\ +aperture [m] & mat6_calc_method & tilt [rad] & y1_edge [m] \\ +aperture_at & material_type & tilt_tot [rad] & y1_limit [m] \\ +aperture_type & offset [m] & tracking_method & y2_edge [m] \\ +area_density [kg/m$^2$] & offset_moves_aperture & type & y2_limit [m] \\ +area_density_used [kg/m$^2$] & p0c [eV] & wall & y_limit [m] \\ +create_jumbo_slave & ptc_integration_type & wrap_superimpose & y_offset [m] \\ +delta_ref_time [sec] & radiation_length [m] & x1_edge [m] & y_offset_tot [m] \\ +density [kg/m$^3$] & radiation_length_used [m] & x1_limit [m] & y_pitch [rad] \\ +density_used [kg/m$^3$] & ref_origin & x2_edge [m] & y_pitch_tot [rad] \\ +descrip & ref_time_start [sec] & x2_limit [m] & z_offset [m] \\ +e_tot [eV] & reference & x_limit [m] & z_offset_tot [m] \\ +ele_origin & scatter & x_offset [m] & \\ +final_charge & spin_tracking_method & x_offset_tot [m] & \\ +is_on & superimpose & x_pitch [rad] & \\ \bottomrule \end{tabular} \vfill @@ -554,7 +557,7 @@ \chapter{List of Element Attributes} \begin{tabular}{llll} \toprule alias & is_on & ref_origin & wrap_superimpose \\ aperture [m] & ix_to_branch & ref_species & x1_limit [m] \\ -aperture_at & ix_to_element & ref_time_start [???] & x2_limit [m] \\ +aperture_at & ix_to_element & ref_time_start [sec] & x2_limit [m] \\ aperture_type & l [m] & reference & x_limit [m] \\ create_jumbo_slave & mat6_calc_method & spin_tracking_method & y1_limit [m] \\ delta_ref_time [sec] & new_branch & superimpose & y2_limit [m] \\ @@ -571,7 +574,7 @@ \chapter{List of Element Attributes} \label{s:list.gkicker} \begin{tabular}{llll} \toprule -alias & mat6_calc_method & ref_time_start [???] & x_kick [m] \\ +alias & mat6_calc_method & ref_time_start [sec] & x_kick [m] \\ aperture [m] & offset [m] & reference & x_limit [m] \\ aperture_at & offset_moves_aperture & spin_tracking_method & y1_limit [m] \\ aperture_type & p0c [eV] & superimpose & y2_limit [m] \\ @@ -605,10 +608,10 @@ \chapter{List of Element Attributes} \label{s:list.group} \begin{tabular}{llll} \toprule -accordion_edge [m] & gang & start_edge & y_knot \\ -alias & interpolation & type & \\ -descrip & s_position [m] & var & \\ -end_edge [m] & slave & x_knot & \\ +accordion_edge [m] & gang & slave & x_knot \\ +alias & interpolation & start_edge & y_knot \\ +descrip & is_on & type & \\ +end_edge [m] & s_position [m] & var & \\ \bottomrule \end{tabular} \vfill @@ -619,7 +622,7 @@ \chapter{List of Element Attributes} \begin{tabular}{llll} \toprule alias & e_tot [eV] & ref_origin & x1_limit [m] \\ -aperture [m] & ele_origin & ref_time_start [???] & x2_limit [m] \\ +aperture [m] & ele_origin & ref_time_start [sec] & x2_limit [m] \\ aperture_at & l [m] & reference & x_limit [m] \\ aperture_type & mat6_calc_method & spin_tracking_method & y1_limit [m] \\ create_jumbo_slave & offset [m] & superimpose & y2_limit [m] \\ @@ -654,7 +657,7 @@ \chapter{List of Element Attributes} ele_origin & p0c [eV] & x1_limit [m] & y_pitch [rad] \\ field_calc & ptc_integration_type & x2_limit [m] & y_pitch_tot [rad] \\ field_overlaps & ref_origin & x_dispersion_calib [m] & z_offset [m] \\ -fringe_at & ref_time_start [???] & x_dispersion_err [m] & z_offset_tot [m] \\ +fringe_at & ref_time_start [sec] & x_dispersion_err [m] & z_offset_tot [m] \\ fringe_type & reference & x_gain_calib [m] & \\ hkick & space_charge_method & x_gain_err [m] & \\ \bottomrule @@ -670,7 +673,7 @@ \chapter{List of Element Attributes} alias & gen_grad_map & r0_elec [m] & wall \\ aperture [m] & grid_field & r0_mag [m] & wrap_superimpose \\ aperture_at & h_displace [m] & ref_origin & x1_limit [m] \\ -aperture_type & hkick & ref_time_start [???] & x2_limit [m] \\ +aperture_type & hkick & ref_time_start [sec] & x2_limit [m] \\ bl_hkick [T*m] & integrator_order & reference & x_limit [m] \\ bl_vkick [T*m] & is_on & scale_multipoles & x_offset [m] \\ cartesian_map & l [m] & space_charge_method & x_offset_tot [m] \\ @@ -700,7 +703,7 @@ \chapter{List of Element Attributes} alias & fringe_type & ptc_canonical_coords & wall \\ aperture [m] & gen_grad_map & ptc_integration_type & wrap_superimpose \\ aperture_at & grid_field & ref_origin & x1_limit [m] \\ -aperture_type & integrator_order & ref_time_start [???] & x2_limit [m] \\ +aperture_type & integrator_order & ref_time_start [sec] & x2_limit [m] \\ bl_kick [T*m] & is_on & reference & x_limit [m] \\ cartesian_map & kick & scale_multipoles & x_offset [m] \\ create_jumbo_slave & l [m] & space_charge_method & x_offset_tot [m] \\ @@ -735,7 +738,7 @@ \chapter{List of Element Attributes} cartesian_map & gradient_err [eV/m] & phi0_multipass [rad/2pi] & wrap_superimpose \\ cavity_type & gradient_tot [eV/m] & ptc_integration_type & x1_limit [m] \\ coupler_angle [rad] & grid_field & ref_origin & x2_limit [m] \\ -coupler_at & hkick & ref_time_start [???] & x_limit [m] \\ +coupler_at & hkick & ref_time_start [sec] & x_limit [m] \\ coupler_phase [rad/2pi] & integrator_order & reference & x_offset [m] \\ coupler_strength & is_on & rf_frequency [Hz] & x_offset_tot [m] \\ create_jumbo_slave & l [m] & rf_wavelength [m] & x_pitch [rad] \\ @@ -765,7 +768,7 @@ \chapter{List of Element Attributes} create_jumbo_slave & ptc_integration_type & wall & y_limit [m] \\ delta_ref_time [sec] & radius [m] & wrap_superimpose & y_offset [m] \\ descrip & ref_origin & x1_limit [m] & y_offset_tot [m] \\ -e_tot [eV] & ref_time_start [???] & x2_limit [m] & y_pitch [rad] \\ +e_tot [eV] & ref_time_start [sec] & x2_limit [m] & y_pitch [rad] \\ ele_origin & reference & x_limit [m] & y_pitch_tot [rad] \\ focal_strength [1/m] & spin_tracking_method & x_offset [m] & z_offset [m] \\ l [m] & superimpose & x_offset_tot [m] & z_offset_tot [m] \\ @@ -808,7 +811,7 @@ \chapter{List of Element Attributes} delta_ref_time [sec] & ptc_integration_type & x2_limit [m] & y_limit [m] \\ descrip & ref_origin & x_dispersion_calib [m] & y_offset [m] \\ e_tot [eV] & ref_species & x_dispersion_err [m] & y_offset_calib [m] \\ -ele_origin & ref_time_start [???] & x_gain_calib [m] & y_offset_tot [m] \\ +ele_origin & ref_time_start [sec] & x_gain_calib [m] & y_offset_tot [m] \\ is_on & reference & x_gain_err [m] & y_pitch [rad] \\ l [m] & spin_tracking_method & x_limit [m] & y_pitch_tot [rad] \\ lr_freq_spread [Hz] & sr_wake & x_offset [m] & z_offset [m] \\ @@ -829,7 +832,7 @@ \chapter{List of Element Attributes} aperture_type & p0c [eV] & wall & y_offset [m] \\ create_jumbo_slave & ptc_integration_type & wrap_superimpose & y_offset_tot [m] \\ delta_ref_time [sec] & ref_origin & x1_limit [m] & y_pitch [rad] \\ -descrip & ref_time_start [???] & x2_limit [m] & y_pitch_tot [rad] \\ +descrip & ref_time_start [sec] & x2_limit [m] & y_pitch_tot [rad] \\ e_tot [eV] & ref_wavelength [m] & x_limit [m] & z_offset [m] \\ ele_origin & reference & x_offset [m] & z_offset_tot [m] \\ field_scale_factor & spin_tracking_method & x_offset_tot [m] & \\ @@ -844,26 +847,25 @@ \chapter{List of Element Attributes} \label{s:list.match} \begin{tabular}{llll} \toprule -alias & create_jumbo_slave & match_end_input & spin_tracking_method \\ -alpha_a0 & delta_ref_time [sec] & match_end_orbit & superimpose \\ -alpha_a1 & delta_time [sec] & match_end_orbit_input & tracking_method \\ -alpha_b0 & descrip & mode_flip0 & type \\ -alpha_b1 & dphi_a [rad] & mode_flip1 & wrap_superimpose \\ -aperture [m] & dphi_b [rad] & offset [m] & x0 [m] \\ -aperture_at & e_tot [eV] & offset_moves_aperture & x1 [m] \\ -aperture_type & ele_origin & p0c [eV] & x1_limit [m] \\ -beta_a0 [m] & eta_x0 [m] & phase_trombone & x2_limit [m] \\ -beta_a1 [m] & eta_x1 [m] & phase_trombone_input & x_limit [m] \\ -beta_b0 [m] & eta_y0 [m] & ptc_integration_type & y0 [m] \\ -beta_b1 [m] & eta_y1 [m] & px0 & y1 [m] \\ -c11_mat0 & etap_x0 & px1 & y1_limit [m] \\ -c11_mat1 & etap_x1 & py0 & y2_limit [m] \\ -c12_mat0 [m] & etap_y0 & py1 & y_limit [m] \\ -c12_mat1 [m] & etap_y1 & pz0 & z0 [m] \\ -c21_mat0 [1/m] & is_on & pz1 & z1 [m] \\ -c21_mat1 [1/m] & l [m] & ref_origin & \\ -c22_mat0 & mat6_calc_method & ref_time_start [???] & \\ -c22_mat1 & match_end & reference & \\ +alias & c22_mat1 & l [m] & spin_tracking_method \\ +alpha_a0 & create_jumbo_slave & mat6_calc_method & superimpose \\ +alpha_a1 & delta_ref_time [sec] & matrix & tracking_method \\ +alpha_b0 & delta_time [sec] & mode_flip0 & type \\ +alpha_b1 & descrip & mode_flip1 & wrap_superimpose \\ +aperture [m] & dphi_a [rad] & offset [m] & x0 [m] \\ +aperture_at & dphi_b [rad] & offset_moves_aperture & x1 [m] \\ +aperture_type & e_tot [eV] & p0c [eV] & x1_limit [m] \\ +beta_a0 [m] & ele_origin & ptc_integration_type & x2_limit [m] \\ +beta_a1 [m] & eta_x0 [m] & px0 & x_limit [m] \\ +beta_b0 [m] & eta_x1 [m] & px1 & y0 [m] \\ +beta_b1 [m] & eta_y0 [m] & py0 & y1 [m] \\ +c11_mat0 & eta_y1 [m] & py1 & y1_limit [m] \\ +c11_mat1 & etap_x0 & pz0 & y2_limit [m] \\ +c12_mat0 [m] & etap_x1 & pz1 & y_limit [m] \\ +c12_mat1 [m] & etap_y0 & recalc [???] & z0 [m] \\ +c21_mat0 [1/m] & etap_y1 & ref_origin & z1 [m] \\ +c21_mat1 [1/m] & is_on & ref_time_start [sec] & \\ +c22_mat0 & kick0 & reference & \\ \bottomrule \end{tabular} \vfill @@ -884,10 +886,10 @@ \chapter{List of Element Attributes} delta_ref_time [sec] & ref_origin & use_reflectivity_table & y_pitch [rad] \\ descrip & ref_tilt [rad] & wall & y_pitch_tot [rad] \\ displacement & ref_tilt_tot [rad] & wrap_superimpose & z_offset [m] \\ -e_tot [eV] & ref_time_start [???] & x1_limit [m] & z_offset_tot [m] \\ +e_tot [eV] & ref_time_start [sec] & x1_limit [m] & z_offset_tot [m] \\ ele_origin & ref_wavelength [m] & x2_limit [m] & \\ elliptical_curvature_x [1/m] & reference & x_limit [m] & \\ -elliptical_curvature_y [1/m] & reflectivity_table [???] & x_offset [m] & \\ +elliptical_curvature_y [1/m] & reflectivity_table & x_offset [m] & \\ \bottomrule \end{tabular} \vfill @@ -911,7 +913,7 @@ \chapter{List of Element Attributes} displacement & ref_origin & v2_unitcell [m$^3$] & y_pitch [rad] \\ e_tot [eV] & ref_tilt [rad] & wall & y_pitch_tot [rad] \\ ele_origin & ref_tilt_tot [rad] & wrap_superimpose & z_offset [m] \\ -elliptical_curvature_x [1/m] & ref_time_start [???] & x1_limit [m] & z_offset_tot [m] \\ +elliptical_curvature_x [1/m] & ref_time_start [sec] & x1_limit [m] & z_offset_tot [m] \\ \bottomrule \end{tabular} \vfill @@ -929,7 +931,7 @@ \chapter{List of Element Attributes} delta_ref_time [sec] & p0c [eV] & wall & y_offset_tot [m] \\ descrip & ptc_integration_type & wrap_superimpose & z_offset [m] \\ e_tot [eV] & ref_origin & x1_limit [m] & z_offset_tot [m] \\ -ele_origin & ref_time_start [???] & x2_limit [m] & \\ +ele_origin & ref_time_start [sec] & x2_limit [m] & \\ field_master & reference & x_limit [m] & \\ is_on & spin_tracking_method & x_offset [m] & \\ \bottomrule @@ -946,7 +948,7 @@ \chapter{List of Element Attributes} aperture [m] & gen_grad_map & r0_elec [m] & wrap_superimpose \\ aperture_at & grid_field & r0_mag [m] & x1_limit [m] \\ aperture_type & hkick & ref_origin & x2_limit [m] \\ -b3_gradient [T/m$^3$] & integrator_order & ref_time_start [???] & x_limit [m] \\ +b3_gradient [T/m$^3$] & integrator_order & ref_time_start [sec] & x_limit [m] \\ bl_hkick [T*m] & is_on & reference & x_offset [m] \\ bl_vkick [T*m] & k3 [1/m$^4$] & scale_multipoles & x_offset_tot [m] \\ cartesian_map & l [m] & space_charge_method & x_pitch [rad] \\ @@ -997,12 +999,11 @@ \chapter{List of Element Attributes} \label{s:list.particle.start} \begin{tabular}{llll} \toprule -direction & field_y & sig_pz & time_dir \\ -e_photon [eV] & phase_x [rad] & sig_z [m] & x [m] \\ -emittance_a [m*rad] & phase_y [rad] & spin_x & y [m] \\ -emittance_b [m*rad] & px & spin_y & z [m] \\ -emittance_z [m*rad] & py & spin_z & \\ -field_x & pz & t [sec] & \\ +e_photon [eV] & field_y & pz & spin_z \\ +emittance_a [m*rad] & phase_x [rad] & sig_pz & t [sec] \\ +emittance_b [m*rad] & phase_y [rad] & sig_z [m] & x [m] \\ +emittance_z [m*rad] & px & spin_x & y [m] \\ +field_x & py & spin_y & z [m] \\ \bottomrule \end{tabular} \vfill @@ -1013,7 +1014,7 @@ \chapter{List of Element Attributes} \begin{tabular}{llll} \toprule alias & e_tot_start [eV] & ref_origin & wrap_superimpose \\ -aperture [m] & ele_origin & ref_time_start [???] & x1_limit [m] \\ +aperture [m] & ele_origin & ref_time_start [sec] & x1_limit [m] \\ aperture_at & field_calc & reference & x2_limit [m] \\ aperture_type & flexible & space_charge_method & x_limit [m] \\ create_jumbo_slave & l [m] & spin_tracking_method & x_offset [m] \\ @@ -1044,7 +1045,7 @@ \chapter{List of Element Attributes} ds_slice [m] & physical_source & superimpose & y1_limit [m] \\ e2_center [eV] & ptc_integration_type & tilt [rad] & y2_limit [m] \\ e2_probability & ref_origin & tilt_tot [rad] & y_limit [m] \\ -e_center [eV] & ref_time_start [???] & tracking_method & y_offset [m] \\ +e_center [eV] & ref_time_start [sec] & tracking_method & y_offset [m] \\ e_center_relative_to_ref & ref_wavelength [m] & transverse_sigma_cut & y_offset_tot [m] \\ e_field_x [V/m] & reference & type & y_pitch [rad] \\ e_field_y [V/m] & scale_field_to_one & velocity_distribution & y_pitch_tot [rad] \\ @@ -1066,7 +1067,7 @@ \chapter{List of Element Attributes} aperture_type & gen_grad_map & r0_elec [m] & wrap_superimpose \\ b1_gradient [T/m] & grid_field & r0_mag [m] & x1_limit [m] \\ bl_hkick [T*m] & hkick & ref_origin & x2_limit [m] \\ -bl_vkick [T*m] & integrator_order & ref_time_start [???] & x_limit [m] \\ +bl_vkick [T*m] & integrator_order & ref_time_start [sec] & x_limit [m] \\ cartesian_map & is_on & reference & x_offset [m] \\ create_jumbo_slave & k1 [1/m$^2$] & scale_multipoles & x_offset_tot [m] \\ csr_ds_step [m] & l [m] & space_charge_method & x_pitch [rad] \\ @@ -1089,27 +1090,28 @@ \chapter{List of Element Attributes} \label{s:list.rf.bend} \begin{tabular}{llll} \toprule -alias & g [1/m] & phi0_multipass [rad/2pi] & tracking_method \\ -angle [rad] & grid_field & ptc_integration_type & type \\ -aperture [m] & harmon & ref_origin & vkick \\ -aperture_at & hkick & ref_tilt [rad] & wall \\ -aperture_type & integrator_order & ref_tilt_tot [rad] & wrap_superimpose \\ -b_field [T] & is_on & ref_time_start [???] & x1_limit [m] \\ -bl_hkick [T*m] & l [m] & reference & x2_limit [m] \\ -bl_vkick [T*m] & l_chord [m] & rf_frequency [Hz] & x_limit [m] \\ -create_jumbo_slave & l_sagitta [m] & rf_wavelength [m] & x_offset [m] \\ -csr_ds_step [m] & lord_pad1 [m] & rho [m] & x_offset_tot [m] \\ -csr_method & lord_pad2 [m] & roll [rad] & x_pitch [rad] \\ -delta_ref_time [sec] & lr_freq_spread [Hz] & roll_tot [rad] & x_pitch_tot [rad] \\ -descrip & lr_self_wake_on & space_charge_method & y1_limit [m] \\ -ds_step [m] & lr_wake & spin_fringe_on & y2_limit [m] \\ -e_tot [eV] & lr_wake_file & spin_tracking_method & y_limit [m] \\ -ele_origin & mat6_calc_method & sr_wake & y_offset [m] \\ -field_calc & num_steps & sr_wake_file & y_offset_tot [m] \\ -field_master & offset [m] & static_linear_map & y_pitch [rad] \\ -field_overlaps & offset_moves_aperture & superimpose & y_pitch_tot [rad] \\ -fringe_at & p0c [eV] & symplectify & z_offset [m] \\ -fringe_type & phi0 [rad/2pi] & taylor_map_includes_offsets & z_offset_tot [m] \\ +alias & grid_field & ptc_integration_type & vkick \\ +angle [rad] & harmon & ref_origin & wall \\ +aperture [m] & harmon_master & ref_tilt [rad] & wrap_superimpose \\ +aperture_at & hkick & ref_tilt_tot [rad] & x1_limit [m] \\ +aperture_type & integrator_order & ref_time_start [sec] & x2_limit [m] \\ +b_field [T] & is_on & reference & x_limit [m] \\ +bl_hkick [T*m] & l [m] & rf_frequency [Hz] & x_offset [m] \\ +bl_vkick [T*m] & l_chord [m] & rf_wavelength [m] & x_offset_tot [m] \\ +create_jumbo_slave & l_sagitta [m] & rho [m] & x_pitch [rad] \\ +csr_ds_step [m] & lord_pad1 [m] & roll [rad] & x_pitch_tot [rad] \\ +csr_method & lord_pad2 [m] & roll_tot [rad] & y1_limit [m] \\ +delta_ref_time [sec] & lr_freq_spread [Hz] & space_charge_method & y2_limit [m] \\ +descrip & lr_self_wake_on & spin_fringe_on & y_limit [m] \\ +ds_step [m] & lr_wake & spin_tracking_method & y_offset [m] \\ +e_tot [eV] & lr_wake_file & sr_wake & y_offset_tot [m] \\ +ele_origin & mat6_calc_method & sr_wake_file & y_pitch [rad] \\ +field_calc & num_steps & static_linear_map & y_pitch_tot [rad] \\ +field_master & offset [m] & superimpose & z_offset [m] \\ +field_overlaps & offset_moves_aperture & symplectify & z_offset_tot [m] \\ +fringe_at & p0c [eV] & taylor_map_includes_offsets & \\ +fringe_type & phi0 [rad/2pi] & tracking_method & \\ +g [1/m] & phi0_multipass [rad/2pi] & type & \\ \bottomrule \end{tabular} \vfill @@ -1119,29 +1121,30 @@ \chapter{List of Element Attributes} \label{s:list.rfcavity} \begin{tabular}{llll} \toprule -alias & field_autoscale & num_steps & tilt_tot [rad] \\ -aperture [m] & field_calc & offset [m] & tracking_method \\ -aperture_at & field_overlaps & offset_moves_aperture & type \\ -aperture_type & fringe_at & p0c [eV] & vkick \\ -autoscale_amplitude & fringe_type & phi0 [rad/2pi] & voltage [Volt] \\ -autoscale_phase & gen_grad_map & phi0_autoscale [rad/2pi] & wall \\ -bl_hkick [T*m] & gradient [eV/m] & phi0_multipass [rad/2pi] & wrap_superimpose \\ -bl_vkick [T*m] & grid_field & ptc_integration_type & x1_limit [m] \\ -cartesian_map & harmon & ref_origin & x2_limit [m] \\ -cavity_type & hkick & ref_time_start [???] & x_limit [m] \\ -coupler_angle [rad] & integrator_order & reference & x_offset [m] \\ -coupler_at & is_on & rf_frequency [Hz] & x_offset_tot [m] \\ -coupler_phase [rad/2pi] & l [m] & rf_wavelength [m] & x_pitch [rad] \\ -coupler_strength & l_active [m] & space_charge_method & x_pitch_tot [rad] \\ -create_jumbo_slave & longitudinal_mode & spin_fringe_on & y1_limit [m] \\ -csr_ds_step [m] & lord_pad1 [m] & spin_tracking_method & y2_limit [m] \\ -csr_method & lord_pad2 [m] & sr_wake & y_limit [m] \\ -cylindrical_map & lr_freq_spread [Hz] & sr_wake_file & y_offset [m] \\ -delta_ref_time [sec] & lr_self_wake_on & static_linear_map & y_offset_tot [m] \\ -descrip & lr_wake & superimpose & y_pitch [rad] \\ -ds_step [m] & lr_wake_file & symplectify & y_pitch_tot [rad] \\ -e_tot [eV] & mat6_calc_method & taylor_map_includes_offsets & z_offset [m] \\ -ele_origin & n_cell & tilt [rad] & z_offset_tot [m] \\ +alias & field_calc & offset [m] & type \\ +aperture [m] & field_overlaps & offset_moves_aperture & vkick \\ +aperture_at & fringe_at & p0c [eV] & voltage [Volt] \\ +aperture_type & fringe_type & phi0 [rad/2pi] & wall \\ +autoscale_amplitude & gen_grad_map & phi0_autoscale [rad/2pi] & wrap_superimpose \\ +autoscale_phase & gradient [eV/m] & phi0_multipass [rad/2pi] & x1_limit [m] \\ +bl_hkick [T*m] & grid_field & ptc_integration_type & x2_limit [m] \\ +bl_vkick [T*m] & harmon & ref_origin & x_limit [m] \\ +cartesian_map & harmon_master & ref_time_start [sec] & x_offset [m] \\ +cavity_type & hkick & reference & x_offset_tot [m] \\ +coupler_angle [rad] & integrator_order & rf_frequency [Hz] & x_pitch [rad] \\ +coupler_at & is_on & rf_wavelength [m] & x_pitch_tot [rad] \\ +coupler_phase [rad/2pi] & l [m] & space_charge_method & y1_limit [m] \\ +coupler_strength & l_active [m] & spin_fringe_on & y2_limit [m] \\ +create_jumbo_slave & longitudinal_mode & spin_tracking_method & y_limit [m] \\ +csr_ds_step [m] & lord_pad1 [m] & sr_wake & y_offset [m] \\ +csr_method & lord_pad2 [m] & sr_wake_file & y_offset_tot [m] \\ +cylindrical_map & lr_freq_spread [Hz] & static_linear_map & y_pitch [rad] \\ +delta_ref_time [sec] & lr_self_wake_on & superimpose & y_pitch_tot [rad] \\ +descrip & lr_wake & symplectify & z_offset [m] \\ +ds_step [m] & lr_wake_file & taylor_map_includes_offsets & z_offset_tot [m] \\ +e_tot [eV] & mat6_calc_method & tilt [rad] & \\ +ele_origin & n_cell & tilt_tot [rad] & \\ +field_autoscale & num_steps & tracking_method & \\ \bottomrule \end{tabular} \vfill @@ -1164,7 +1167,7 @@ \chapter{List of Element Attributes} \begin{tabular}{llll} \toprule a0 - a20, b0 - b20 & fb2 [m] & ref_origin & x2_limit [m] \\ -alias & field_calc & ref_time_start [???] & x_limit [m] \\ +alias & field_calc & ref_time_start [sec] & x_limit [m] \\ aperture [m] & fq1 [m] & reference & x_offset [m] \\ aperture_at & fq2 [m] & rho [m] & x_offset_mult [m] \\ aperture_type & fringe_at & space_charge_method & x_offset_tot [m] \\ @@ -1201,7 +1204,7 @@ \chapter{List of Element Attributes} descrip & p0c [eV] & wall & y_offset_tot [m] \\ displacement & ptc_integration_type & wrap_superimpose & y_pitch [rad] \\ e_tot [eV] & ref_origin & x1_limit [m] & y_pitch_tot [rad] \\ -ele_origin & ref_time_start [???] & x2_limit [m] & z_offset [m] \\ +ele_origin & ref_time_start [sec] & x2_limit [m] & z_offset [m] \\ elliptical_curvature_x [1/m] & reference & x_limit [m] & z_offset_tot [m] \\ \bottomrule \end{tabular} @@ -1217,7 +1220,7 @@ \chapter{List of Element Attributes} aperture [m] & gen_grad_map & r0_elec [m] & wrap_superimpose \\ aperture_at & grid_field & r0_mag [m] & x1_limit [m] \\ aperture_type & hkick & ref_origin & x2_limit [m] \\ -b2_gradient [T/m$^2$] & integrator_order & ref_time_start [???] & x_limit [m] \\ +b2_gradient [T/m$^2$] & integrator_order & ref_time_start [sec] & x_limit [m] \\ bl_hkick [T*m] & is_on & reference & x_offset [m] \\ bl_vkick [T*m] & k2 [1/m$^3$] & scale_multipoles & x_offset_tot [m] \\ cartesian_map & l [m] & space_charge_method & x_pitch [rad] \\ @@ -1249,7 +1252,7 @@ \chapter{List of Element Attributes} aperture_type & grid_field & r0_elec [m] & wrap_superimpose \\ b1_gradient [T/m] & hkick & r0_mag [m] & x1_limit [m] \\ bl_hkick [T*m] & integrator_order & ref_origin & x2_limit [m] \\ -bl_vkick [T*m] & is_on & ref_time_start [???] & x_limit [m] \\ +bl_vkick [T*m] & is_on & ref_time_start [sec] & x_limit [m] \\ bs_field [T] & k1 [1/m$^2$] & reference & x_offset [m] \\ cartesian_map & ks [1/m] & scale_multipoles & x_offset_tot [m] \\ create_jumbo_slave & l [m] & space_charge_method & x_pitch [rad] \\ @@ -1279,7 +1282,7 @@ \chapter{List of Element Attributes} aperture_type & hkick & r0_mag [m] & wrap_superimpose \\ bl_hkick [T*m] & integrator_order & r_solenoid [m] & x1_limit [m] \\ bl_vkick [T*m] & is_on & ref_origin & x2_limit [m] \\ -bs_field [T] & ks [1/m] & ref_time_start [???] & x_limit [m] \\ +bs_field [T] & ks [1/m] & ref_time_start [sec] & x_limit [m] \\ cartesian_map & l [m] & reference & x_offset [m] \\ create_jumbo_slave & l_soft_edge [m] & scale_multipoles & x_offset_tot [m] \\ csr_ds_step [m] & lord_pad1 [m] & space_charge_method & x_pitch [rad] \\ @@ -1312,7 +1315,7 @@ \chapter{List of Element Attributes} descrip & pz_ref & wall & y_offset_tot [m] \\ e_tot [eV] & ref_orbit & wrap_superimpose & y_pitch [rad] \\ ele_origin & ref_origin & x1_limit [m] & y_pitch_tot [rad] \\ -is_on & ref_time_start [???] & x2_limit [m] & y_ref [m] \\ +is_on & ref_time_start [sec] & x2_limit [m] & y_ref [m] \\ l [m] & reference & x_limit [m] & z_offset [m] \\ lord_pad1 [m] & spin_tracking_method & x_offset [m] & z_offset_tot [m] \\ lord_pad2 [m] & superimpose & x_offset_tot [m] & z_ref [m] \\ @@ -1320,6 +1323,35 @@ \chapter{List of Element Attributes} \end{tabular} \vfill + %--------------------------------- + \section{Thick_Multipole Element Attributes} + \label{s:list.thick.multipole} + + \begin{tabular}{llll} \toprule +a0 - a20, b0 - b20 & fringe_at & ptc_canonical_coords & wall \\ +alias & fringe_type & ptc_integration_type & wrap_superimpose \\ +aperture [m] & gen_grad_map & ref_origin & x1_limit [m] \\ +aperture_at & grid_field & ref_time_start [sec] & x2_limit [m] \\ +aperture_type & hkick & reference & x_limit [m] \\ +bl_hkick [T*m] & integrator_order & scale_multipoles & x_offset [m] \\ +bl_vkick [T*m] & is_on & space_charge_method & x_offset_tot [m] \\ +cartesian_map & l [m] & spin_fringe_on & x_pitch [rad] \\ +create_jumbo_slave & lord_pad1 [m] & spin_tracking_method & x_pitch_tot [rad] \\ +csr_ds_step [m] & lord_pad2 [m] & sr_wake & y1_limit [m] \\ +csr_method & lr_freq_spread [Hz] & sr_wake_file & y2_limit [m] \\ +cylindrical_map & lr_self_wake_on & static_linear_map & y_limit [m] \\ +delta_ref_time [sec] & lr_wake & superimpose & y_offset [m] \\ +descrip & lr_wake_file & symplectify & y_offset_tot [m] \\ +ds_step [m] & mat6_calc_method & taylor_map_includes_offsets & y_pitch [rad] \\ +e_tot [eV] & multipoles_on & tilt [rad] & y_pitch_tot [rad] \\ +ele_origin & num_steps & tilt_tot [rad] & z_offset [m] \\ +field_calc & offset [m] & tracking_method & z_offset_tot [m] \\ +field_master & offset_moves_aperture & type & \\ +field_overlaps & p0c [eV] & vkick & \\ + \bottomrule + \end{tabular} + \vfill + %--------------------------------- \section{Wiggler and Undulator Element Attributes} \label{s:list.wiggler} @@ -1333,7 +1365,7 @@ \chapter{List of Element Attributes} b_max [T] & is_on & r0_elec [m] & x1_limit [m] \\ bl_hkick [T*m] & k1x [1/m$^2$] & r0_mag [m] & x2_limit [m] \\ bl_vkick [T*m] & k1y [1/m$^2$] & ref_origin & x_limit [m] \\ -cartesian_map & kx [1/m] & ref_time_start [???] & x_offset [m] \\ +cartesian_map & kx [1/m] & ref_time_start [sec] & x_offset [m] \\ create_jumbo_slave & l [m] & reference & x_offset_tot [m] \\ csr_ds_step [m] & l_period [m] & scale_multipoles & x_pitch [rad] \\ csr_method & lord_pad1 [m] & space_charge_method & x_pitch_tot [rad] \\ diff --git a/util_programs/sad_to_bmad/sad_to_bmad.py b/util_programs/sad_to_bmad/sad_to_bmad.py index 9c6f432672..5170b1ead0 100755 --- a/util_programs/sad_to_bmad/sad_to_bmad.py +++ b/util_programs/sad_to_bmad/sad_to_bmad.py @@ -146,6 +146,9 @@ def add_parens (str, operand): 'quad:k1': ['k1', ' / @l@'], 'sext:k2': ['k2', ' / @l@'], 'oct:k3': ['k3', ' / @l@'], + 'sad_mult:k1': ['b1', ' / @l@'], # In case a SAD quad -> Bmad sad_mult + 'sad_mult:k2': ['b2', ' / (2 * @l@)'], # In case a SAD sext -> Bmad sad_mult + 'sad_mult:k3': ['b3', ' / (6 * @l@)'], # In case a SAD oct -> Bmad sad_mult 'bend:rotate': ['ref_tilt', ' * -1'], 'bend:drotate': ['roll', ' * -1'], 'l': 'l', @@ -532,6 +535,9 @@ def sad_ele_to_bmad (sad_ele, bmad_ele, sol_status, bz, reversed): if sad_param_name in ignore_sad_param: continue if full_param_name in ignore_sad_param: continue + if bmad_ele.type == 'sad_mult' and sad_ele.type != 'mult': # EG: In a solenoid field, SAD quad -> Bmad sad_mult + full_param_name = bmad_ele.type + ':' + sad_param_name + # Use more specific translation first if full_param_name in ele_param_translate: