Skip to content

Commit

Permalink
Update documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
cemitch99 committed Jun 26, 2023
1 parent cbbca0b commit b4e3a50
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/source/usage/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,21 @@ Lattice Elements
* ``<element_name>.type`` (``string``)
Indicates the element type for this lattice element. This should be one of:

* ``cfbend`` for a combined function bending magnet. This requires these additional parameters:

* ``<element_name>.ds`` (``float``, in meters) the segment length

* ``<element_name>.rc`` (``float``, in meters) the bend radius

* ``<element_name>.k`` (``float``, in inverse meters squared) the quadrupole strength

= (magnetic field gradient in T/m) / (magnetic rigidity in T-m)

* k > 0 horizontal focusing
* k < 0 horizontal defocusing

* ``<element_name>.nslice`` (``integer``) number of slices used for the application of space charge (default: ``1``)

* ``drift`` for a free drift. This requires these additional parameters:

* ``<element_name>.ds`` (``float``, in meters) the segment length
Expand Down
12 changes: 12 additions & 0 deletions docs/source/usage/python.rst
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,18 @@ This module provides elements for the accelerator lattice.
:param madx_file: file name to MAD-X file with beamline elements
:param nslice: number of slices used for the application of space charge

.. py:class:: impactx.elements.CFbend(ds, rc, k, nslice=1)
A combined function bending magnet. This is an ideal Sbend with a normal quadrupole field component.

:param ds: Segment length in m.
:param rc: Radius of curvature in m.
:param k: Quadrupole strength in m^(-2) (MADX convention)
= (gradient in T/m) / (rigidity in T-m)
k > 0 horizontal focusing
k < 0 horizontal defocusing
:param nslice: number of slices used for the application of space charge

.. py:class:: impactx.elements.ConstF(ds, kx, ky, kt, nslice=1)
A linear Constant Focusing element.
Expand Down
11 changes: 11 additions & 0 deletions src/python/elements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,17 @@ void init_elements(py::module& m)
)
;

py::class_<CFbend, elements::Thick>(me, "CFbend")
.def(py::init<
amrex::ParticleReal const,
amrex::ParticleReal const,
amrex::ParticleReal const,
int const>(),
py::arg("ds"), py::arg("rc"), py::arg("k"), py::arg("nslice") = 1,
"An ideal combined function bend (sector bend with quadrupole component)."
)
;

py::class_<ShortRF, elements::Thin>(me, "ShortRF")
.def(py::init<
amrex::ParticleReal const,
Expand Down

0 comments on commit b4e3a50

Please sign in to comment.