diff --git a/docs/source/usage/parameters.rst b/docs/source/usage/parameters.rst index 87cedae58..123488f6d 100644 --- a/docs/source/usage/parameters.rst +++ b/docs/source/usage/parameters.rst @@ -235,6 +235,21 @@ Lattice Elements * ``.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: + + * ``.ds`` (``float``, in meters) the segment length + + * ``.rc`` (``float``, in meters) the bend radius + + * ``.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 + + * ``.nslice`` (``integer``) number of slices used for the application of space charge (default: ``1``) + * ``drift`` for a free drift. This requires these additional parameters: * ``.ds`` (``float``, in meters) the segment length diff --git a/docs/source/usage/python.rst b/docs/source/usage/python.rst index 658b46041..e85fcbd72 100644 --- a/docs/source/usage/python.rst +++ b/docs/source/usage/python.rst @@ -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. diff --git a/src/python/elements.cpp b/src/python/elements.cpp index 737738b2a..e4ff27d3c 100644 --- a/src/python/elements.cpp +++ b/src/python/elements.cpp @@ -288,6 +288,17 @@ void init_elements(py::module& m) ) ; + py::class_(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_(me, "ShortRF") .def(py::init< amrex::ParticleReal const,