Skip to content

Commit

Permalink
Merge pull request #613 from bmad-sim/devel/47
Browse files Browse the repository at this point in the history
Fix bug in bmad to elegant conversion.
  • Loading branch information
DavidSagan authored Nov 2, 2023
2 parents b1440e9 + 5a20104 commit d6bace5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
Binary file modified bmad-doc/other_manuals/tune_scan.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion bmad/code/multipole_ele_to_ab.f90
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ recursive subroutine multipole_ele_to_ab (ele, use_ele_tilt, ix_pole_max, a, b,

ix_pole_max = -1

if (.not. ele%is_on) then
if (.not. ele%is_on .or. ele%key == pipe$) then
a = 0; b = 0
if (present(b1)) b1 = 0
return
Expand Down
5 changes: 4 additions & 1 deletion bmad/code/write_lattice_in_foreign_format.f90
Original file line number Diff line number Diff line change
Expand Up @@ -763,12 +763,13 @@ subroutine write_lattice_in_foreign_format (out_type, out_file_name, lat, ref_or
elegant_params(:12) = [character(40):: 'l', 'angle', 'e1', 'e2', 'tilt', 'etilt', 'h1', 'h2', 'ykick', 'dx', 'dy', 'dz']

case (quadrupole$) ! Elegant
knl = knl / ele%value(l$)
if (knl(2) == 0) then
write (line_out, '(2a)') trim(ele%name) // ': kquad'
if (ele%value(x_pitch$) /= 0 .or. ele%value(y_pitch$) /= 0) line_out = trim(line_out) // ', malign_method = 2'
else
write (line_out, '(2a)') trim(ele%name) // ': kquse'
call value_to_line (line_out, knl(2)*cos(3*(tilts(2)-tilts(1)))/2, 'k2', 'R')
call value_to_line (line_out, 0.5_rp*knl(2)*cos(3*(tilts(2)-tilts(1))), 'k2', 'R')
endif

tilt = tilts(1)
Expand All @@ -778,6 +779,7 @@ subroutine write_lattice_in_foreign_format (out_type, out_file_name, lat, ref_or
elegant_params(:1) = [character(40):: 'l']

case (sextupole$) ! Elegant
knl = knl / ele%value(l$)
write (line_out, '(2a)') trim(ele%name) // ': ksext'
if (ele%value(x_pitch$) /= 0 .or. ele%value(y_pitch$) /= 0) line_out = trim(line_out) // ', malign_method = 2'
call value_to_line (line_out, knl(2), 'k2', 'R')
Expand All @@ -791,6 +793,7 @@ subroutine write_lattice_in_foreign_format (out_type, out_file_name, lat, ref_or
elegant_params(:1) = [character(40):: 'l']

case (octupole$) ! Elegant
knl = knl / ele%value(l$)
write (line_out, '(2a)') trim(ele%name) // ': koct'
call value_to_line (line_out, knl(3), 'k3', 'R')
call value_to_line (line_out, knl(0)*cos(tilts(0)), 'hkick', 'R')
Expand Down
6 changes: 5 additions & 1 deletion bsim/tune_scan/doc/tune_scan.tex
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@

\title{Tune Scan Program}
\author{}
\date{David Sagan \\ October 24, 2023}
\date{David Sagan \\ November 1, 2023}
\begin{document}
\maketitle

Expand Down Expand Up @@ -423,6 +423,10 @@
amp_a_max, amp_b_max, amp_z_max
! Max amplitude for the three modes.
\end{code}
\vn{Amp_a}, \vn{amp_b} and \vn{amp_z} are dimensionless normal mode amplitudes normalized by the
normal mode emittances.


\begin{description}
\item[ja, jb, jz] \Newline
Indexes \vn{ja}, \vn{jb}, and \vn{jz} start from zero which corresponds to tunes \vn{ts%Q_a0},
Expand Down
2 changes: 1 addition & 1 deletion tao/version/tao_version_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
!-

module tao_version_mod
character(*), parameter :: tao_version_date = "2023/10/30 14:13:28"
character(*), parameter :: tao_version_date = "2023/11/01 11:06:58"
end module

0 comments on commit d6bace5

Please sign in to comment.