Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions manual/introduction.tex
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ \section{Lattice Elements}
One class are the elements that particles are tracked through. These ``tracking'' elements are
contained in the ``tracking branches'' (\sref{s:branch.def}) of the lattice. Other elements,
called ``\vn{lord}'' elements, are used to
represent relationships between elements. ``\vn{Super_lord}'' elements (\sref{c:super}) are
represent relationships between elements. ``\vn{Super-lord}'' elements (\sref{c:super}) are
used when elements overlap spatially. ``\vn{Multipass_lord}'' elements (\ref{c:multipass})
are used when a beam goes through the same elements multiple times like in a recirculating Linac
or when different beam go through the same elements like in the interaction region of a
Expand Down Expand Up @@ -279,13 +279,13 @@ \section{Differences From Bmad}
%
\item
With \bmad superposition of two non-drift elements, if there existed the appropriate
combined type, will result in a \vn{super_slave} of the appropriate combined type. For example,
a \vn{solenoid} superimposed over a \vn{quadrupole} would give a \vn{sol_quad} \vn{super_slave} with
\vn{solenoid} and \vn{quadrupole} \vn{super_lords}. The problem here is that calculation of the
\vn{super_slave} parameters may not be possible. For example if the \vn{super_lord}
elements are misaligned, in general it is not possible to compute a corresponding \vn{super_slave}
misalignment. To avoid this, \accellat creates a \vn{UnionEle} \vn{super_slave} element
(which in \bmad is known as a ``jumbo'' \vn{super_slave}). It is up to the tracking routines to
combined type, will result in a super-slave of the appropriate combined type. For example,
a \vn{solenoid} superimposed over a \vn{quadrupole} would give a \vn{sol_quad} super slave with
\vn{solenoid} and \vn{quadrupole} super lords. The problem here is that calculation of the
super slave parameters may not be possible. For example if the super lord
elements are misaligned, in general it is not possible to compute a corresponding super slave
misalignment. To avoid this, \accellat creates a \vn{UnionEle} super slave element
(which in \bmad is known as a ``jumbo'' super slave). It is up to the tracking routines to
figure out how to track though a \vn{UnionEle}
%
\item
Expand Down
8 changes: 4 additions & 4 deletions manual/superimpose.tex
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ \section{Superposition on a Drift}
element is just a solenoid. Next comes \vn{M}, \vn{S{\#}1}, and finally \vn{D\#2} is the rest of the
drift outside \vn{S}.

In the above example, \vn{Q} and \vn{S} will be \vn{super_lord} elements (\vn{s:lord.slave}) and
In the above example, \vn{Q} and \vn{S} will be super lord elements (\vn{s:lord.slave}) and
four elements in the tracking part of the lattice will be \vn{super_slave} elements. This is
illustrated in \fig{f:super.ex}B.

Expand Down Expand Up @@ -339,7 +339,7 @@ \section{Superposition on a Drift}
my_oct: octupole, ..., superimpose, ref = a_drft##2 ! This is an error
\end{example}

When the parameters of a super_slave are computed from the parameters of its super_lords, some types
When the parameters of a super_slave are computed from the parameters of its super lords, some types
of parameters may be ``missing''. For example, it is, in general, not possible to set appropriate
aperture parameters (\sref{s:limit}) of a super_slave if the lords of the slave have differing
aperture settings. When doing calculations, \bmad will use the corresponding parameters stored in
Expand Down Expand Up @@ -434,15 +434,15 @@ \section{Jumbo Super_Slaves}
\end{example}
\index{lord_pad1}\index{lord_pad2}
\vn{Q} and part of \vn{S} have been combined into a jumbo \vn{super_slave} named \vn{Q{\B}S}. Since
the \vn{super_lord} elements of a jumbo \vn{super_slave} may not completely span the slave two
the super lord elements of a jumbo \vn{super_slave} may not completely span the slave two
parameters of each lord will be set to show the position of the lord within the slave. These two
parameters are
\begin{example}
lord_pad1 ! offset at upstream end
lord_pad2 ! offset at downstream end
\end{example}
\vn{lord_pad1} is the distance between the upstream edge of the jumbo \vn{super_slave} and a
\vn{super_lord}. \vn{lord_pad2} is the distance between the downstream edge of a \vn{super_lord} and
super lord. \vn{lord_pad2} is the distance between the downstream edge of a super lord and
the downstream edge of the jumbo \vn{super_slave}. With the present example, the lords have the
following padding:
\begin{example}
Expand Down
17 changes: 9 additions & 8 deletions src/accessor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function Base.getproperty(lat::Lattice, sym::Symbol)
if sym == :name; return getfield(lat, :name); end
if sym == :branch; return getfield(lat, :branch); end
if sym == :pdict; return getfield(lat, :pdict); end
if sym == :private; return getfield(lat, :private); end

return getfield(lat, :pdict)[sym]
end
Expand Down Expand Up @@ -160,7 +161,7 @@ function Base.setproperty!(ele::Ele, sym::Symbol, value, check_settable = true)

else
branch = lat_branch(ele)
if isnothing(branch) || isnothing(branch.lat) || branch.lat.record_changes
if isnothing(branch) || isnothing(branch.lat) || branch.lat.auditing_enabled
pdict[:changed][sym] = get_elegroup_param(ele, pdict[Symbol(parent)], pinfo)
end

Expand All @@ -183,7 +184,7 @@ function ele_parameter_has_changed!(ele)
branch = lat_branch(ele)
if isnothing(branch) || isnothing(branch.lat); return; end

if branch.lat.record_changes
if branch.lat.auditing_enabled
if branch.type == TrackingBranch
branch.ix_ele_min_changed = min(branch.ix_ele_min_changed, ele.ix_ele)
branch.ix_ele_max_changed = max(branch.ix_ele_max_changed, ele.ix_ele)
Expand Down Expand Up @@ -357,9 +358,9 @@ function set_elegroup_param!(ele::Ele, group::BMultipoleGroup, pinfo::ParamInfo,
if isnothing(mul.integrated)
mul.integrated = (mtype[end] == 'L')
elseif (mtype[end] == 'L') != mul.integrated
error(f"Cannot set non-integrated multipole value for integrated multipole and " *
f"vice versa for {pinfo.user_sym} in {ele_name(ele)}.\n" *
f"Use toggle_integrated! to change the integrated status.")
error("Cannot set non-integrated multipole value for integrated multipole and " *
"vice versa for {pinfo.user_sym} in $(ele_name(ele)).\n" *
"Use toggle_integrated! to change the integrated status.")
end

return setfield!(mul, pinfo.struct_sym, value)
Expand All @@ -373,9 +374,9 @@ function set_elegroup_param!(ele::Ele, group::EMultipoleGroup, pinfo::ParamInfo,
if isnothing(mul.Eintegrated)
mul.Eintegrated = (mtype[end] == 'L')
elseif (mtype[end] == 'L') != mul.Eintegrated
error(f"Cannot set non-integrated multipole value for integrated multipole and " *
f"vice versa for {pinfo.user_sym} in {ele_name(ele)}.\n" *
f"Use toggle_integrated! to change the integrated status.")
error("Cannot set non-integrated multipole value for integrated multipole and " *
"vice versa for {pinfo.user_sym} in $(ele_name(ele)).\n" *
"Use toggle_integrated! to change the integrated status.")
end

return setfield!(mul, pinfo.struct_sym, value)
Expand Down
Loading
Loading