Skip to content

Commit

Permalink
Apply transverse aperture to thick elements. (#788)
Browse files Browse the repository at this point in the history
* Initial files for applying aperture to thick elements.

* Update aperture.H

Add namespace amrex::literals

* Add Python bindings for drift.

* Update elements.cpp

Add Python class for aperture mixin.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add draft example.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Move if conditional into mixin.

* Add drift aperture input documentation.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Apply suggestions from code review

Small changes (excluding naming and std::optional).

Co-authored-by: Axel Huebl <[email protected]>

* Update Drift.H

Remove "maybe unused".

* Change name xmax -> x_aperture...

* Fix one missing xmax -> x_aperture in elements.cpp.

* Modify naming x_aperture -> aperture_x.

* Update src/initialization/InitElement.cpp

* Test workflow for adding elements using CFbend.

* Add aperture input to all thick elements.

* Update thin Aperture element naming.

* Update element parameter docs.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Rename Mixin Class: `PipeAperture`

* Python: Mixin Elements w/o Constructor

We do not want to create variables from them.

* C++: Add `mixin::` Element Namespace

Mirror directory structure and separate from "physical"
elements as we do in Python.

* Input Aperture: Backward Compatible Name

For inputs file.

* Last Commit: Forgot Else

* Rename Mixin File: Pipe Aperture

* Document benchmark example.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Remove comment re idcpu

Co-authored-by: Axel Huebl <[email protected]>

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Axel Huebl <[email protected]>
  • Loading branch information
3 people authored Jan 16, 2025
1 parent 2f38ef9 commit 7f8d15f
Show file tree
Hide file tree
Showing 54 changed files with 1,050 additions and 330 deletions.
34 changes: 32 additions & 2 deletions docs/source/usage/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ Lattice Elements
* ``<element_name>.dx`` (``float``, in meters) horizontal translation error
* ``<element_name>.dy`` (``float``, in meters) vertical translation error
* ``<element_name>.rotation`` (``float``, in degrees) rotation error in the transverse plane
* ``<element_name>.aperture_x`` (``float``, in meters) horizontal half-aperture (elliptical)
* ``<element_name>.aperture_y`` (``float``, in meters) vertical half-aperture (elliptical)
* ``<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:
Expand All @@ -140,6 +142,8 @@ Lattice Elements
* ``<element_name>.dx`` (``float``, in meters) horizontal translation error
* ``<element_name>.dy`` (``float``, in meters) vertical translation error
* ``<element_name>.rotation`` (``float``, in degrees) rotation error in the transverse plane
* ``<element_name>.aperture_x`` (``float``, in meters) horizontal half-aperture (elliptical)
* ``<element_name>.aperture_y`` (``float``, in meters) vertical half-aperture (elliptical)
* ``<element_name>.nslice`` (``integer``) number of slices used for the application of space charge (default: ``1``)

* ``drift_chromatic`` for a free drift, with chromatic effects included.
Expand All @@ -150,6 +154,8 @@ Lattice Elements
* ``<element_name>.dx`` (``float``, in meters) horizontal translation error
* ``<element_name>.dy`` (``float``, in meters) vertical translation error
* ``<element_name>.rotation`` (``float``, in degrees) rotation error in the transverse plane
* ``<element_name>.aperture_x`` (``float``, in meters) horizontal half-aperture (elliptical)
* ``<element_name>.aperture_y`` (``float``, in meters) vertical half-aperture (elliptical)
* ``<element_name>.nslice`` (``integer``) number of slices used for the application of space charge (default: ``1``)

* ``drift_exact`` for a free drift, using the exact nonlinear map. This requires these additional parameters:
Expand All @@ -158,6 +164,8 @@ Lattice Elements
* ``<element_name>.dx`` (``float``, in meters) horizontal translation error
* ``<element_name>.dy`` (``float``, in meters) vertical translation error
* ``<element_name>.rotation`` (``float``, in degrees) rotation error in the transverse plane
* ``<element_name>.aperture_x`` (``float``, in meters) horizontal half-aperture (elliptical)
* ``<element_name>.aperture_y`` (``float``, in meters) vertical half-aperture (elliptical)
* ``<element_name>.nslice`` (``integer``) number of slices used for the application of space charge (default: ``1``)

* ``quad`` for a quadrupole. This requires these additional parameters:
Expand All @@ -172,6 +180,8 @@ Lattice Elements
* ``<element_name>.dx`` (``float``, in meters) horizontal translation error
* ``<element_name>.dy`` (``float``, in meters) vertical translation error
* ``<element_name>.rotation`` (``float``, in degrees) rotation error in the transverse plane
* ``<element_name>.aperture_x`` (``float``, in meters) horizontal half-aperture (elliptical)
* ``<element_name>.aperture_y`` (``float``, in meters) vertical half-aperture (elliptical)
* ``<element_name>.nslice`` (``integer``) number of slices used for the application of space charge (default: ``1``)

* ``quad_chromatic`` for A Quadrupole magnet, with chromatic effects included.
Expand All @@ -191,6 +201,8 @@ Lattice Elements
* ``<element_name>.dx`` (``float``, in meters) horizontal translation error
* ``<element_name>.dy`` (``float``, in meters) vertical translation error
* ``<element_name>.rotation`` (``float``, in degrees) rotation error in the transverse plane
* ``<element_name>.aperture_x`` (``float``, in meters) horizontal half-aperture (elliptical)
* ``<element_name>.aperture_y`` (``float``, in meters) vertical half-aperture (elliptical)
* ``<element_name>.nslice`` (``integer``) number of slices used for the application of space charge (default: ``1``)

* ``quadrupole_softedge`` for a soft-edge quadrupole. This requires these additional parameters:
Expand All @@ -204,6 +216,8 @@ Lattice Elements
* ``<element_name>.dx`` (``float``, in meters) horizontal translation error
* ``<element_name>.dy`` (``float``, in meters) vertical translation error
* ``<element_name>.rotation`` (``float``, in degrees) rotation error in the transverse plane
* ``<element_name>.aperture_x`` (``float``, in meters) horizontal half-aperture (elliptical)
* ``<element_name>.aperture_y`` (``float``, in meters) vertical half-aperture (elliptical)
* ``<element_name>.mapsteps`` (``integer``) number of integration steps per slice used for map and reference particle push in applied fields
(default: ``1``)
* ``<element_name>.nslice`` (``integer``) number of slices used for the application of space charge (default: ``1``)
Expand All @@ -222,6 +236,8 @@ Lattice Elements
* ``<element_name>.dx`` (``float``, in meters) horizontal translation error
* ``<element_name>.dy`` (``float``, in meters) vertical translation error
* ``<element_name>.rotation`` (``float``, in degrees) rotation error in the transverse plane
* ``<element_name>.aperture_x`` (``float``, in meters) horizontal half-aperture (elliptical)
* ``<element_name>.aperture_y`` (``float``, in meters) vertical half-aperture (elliptical)
* ``<element_name>.nslice`` (``integer``) number of slices used for the application of space charge (default: ``1``)

* ``sbend`` for a bending magnet. This requires these additional parameters:
Expand All @@ -231,6 +247,8 @@ Lattice Elements
* ``<element_name>.dx`` (``float``, in meters) horizontal translation error
* ``<element_name>.dy`` (``float``, in meters) vertical translation error
* ``<element_name>.rotation`` (``float``, in degrees) rotation error in the transverse plane
* ``<element_name>.aperture_x`` (``float``, in meters) horizontal half-aperture (elliptical)
* ``<element_name>.aperture_y`` (``float``, in meters) vertical half-aperture (elliptical)
* ``<element_name>.nslice`` (``integer``) number of slices used for the application of space charge (default: ``1``)

* ``sbend_exact`` for a bending magnet using the exact nonlinear map for the bend body. The map corresponds to the map described in:
Expand All @@ -244,6 +262,8 @@ Lattice Elements
* ``<element_name>.dx`` (``float``, in meters) horizontal translation error
* ``<element_name>.dy`` (``float``, in meters) vertical translation error
* ``<element_name>.rotation`` (``float``, in degrees) rotation error in the transverse plane
* ``<element_name>.aperture_x`` (``float``, in meters) horizontal half-aperture (elliptical)
* ``<element_name>.aperture_y`` (``float``, in meters) vertical half-aperture (elliptical)
* ``<element_name>.nslice`` (``integer``) number of slices used for the application of space charge (default: ``1``)

* ``solenoid`` for an ideal hard-edge solenoid magnet. This requires these additional parameters:
Expand All @@ -254,6 +274,8 @@ Lattice Elements
* ``<element_name>.dx`` (``float``, in meters) horizontal translation error
* ``<element_name>.dy`` (``float``, in meters) vertical translation error
* ``<element_name>.rotation`` (``float``, in degrees) rotation error in the transverse plane
* ``<element_name>.aperture_x`` (``float``, in meters) horizontal half-aperture (elliptical)
* ``<element_name>.aperture_y`` (``float``, in meters) vertical half-aperture (elliptical)
* ``<element_name>.nslice`` (``integer``) number of slices used for the application of space charge (default: ``1``)

* ``solenoid_softedge`` for a soft-edge solenoid. This requires these additional parameters:
Expand All @@ -272,6 +294,8 @@ Lattice Elements
* ``<element_name>.dx`` (``float``, in meters) horizontal translation error
* ``<element_name>.dy`` (``float``, in meters) vertical translation error
* ``<element_name>.rotation`` (``float``, in degrees) rotation error in the transverse plane
* ``<element_name>.aperture_x`` (``float``, in meters) horizontal half-aperture (elliptical)
* ``<element_name>.aperture_y`` (``float``, in meters) vertical half-aperture (elliptical)
* ``<element_name>.mapsteps`` (``integer``) number of integration steps per slice used for map and reference particle push in applied fields (default: ``1``)
* ``<element_name>.nslice`` (``integer``) number of slices used for the application of space charge (default: ``1``)

Expand All @@ -294,6 +318,8 @@ Lattice Elements
* ``<element_name>.dx`` (``float``, in meters) horizontal translation error
* ``<element_name>.dy`` (``float``, in meters) vertical translation error
* ``<element_name>.rotation`` (``float``, in degrees) rotation error in the transverse plane
* ``<element_name>.aperture_x`` (``float``, in meters) horizontal half-aperture (elliptical)
* ``<element_name>.aperture_y`` (``float``, in meters) vertical half-aperture (elliptical)
* ``<element_name>.nslice`` (``integer``) number of slices used for the application of space charge (default: ``1``)

* ``rfcavity`` a radiofrequency cavity.
Expand All @@ -309,6 +335,8 @@ Lattice Elements
* ``<element_name>.dx`` (``float``, in meters) horizontal translation error
* ``<element_name>.dy`` (``float``, in meters) vertical translation error
* ``<element_name>.rotation`` (``float``, in degrees) rotation error in the transverse plane
* ``<element_name>.aperture_x`` (``float``, in meters) horizontal half-aperture (elliptical)
* ``<element_name>.aperture_y`` (``float``, in meters) vertical half-aperture (elliptical)
* ``<element_name>.mapsteps`` (``integer``) number of integration steps per slice used for map and reference particle push in applied fields (default: ``1``)
* ``<element_name>.nslice`` (``integer``) number of slices used for the application of space charge (default: ``1``)

Expand Down Expand Up @@ -352,6 +380,8 @@ Lattice Elements
* ``<element_name>.dx`` (``float``, in meters) horizontal translation error
* ``<element_name>.dy`` (``float``, in meters) vertical translation error
* ``<element_name>.rotation`` (``float``, in degrees) rotation error in the transverse plane
* ``<element_name>.aperture_x`` (``float``, in meters) horizontal half-aperture (elliptical)
* ``<element_name>.aperture_y`` (``float``, in meters) vertical half-aperture (elliptical)
* ``<element_name>.nslice`` (``integer``) number of slices used for the application of space charge (default: ``1``)

* ``linear_map`` for a custom, linear transport matrix.
Expand Down Expand Up @@ -430,8 +460,8 @@ Lattice Elements
* ``aperture`` for a thin collimator element applying a transverse aperture boundary.
This requires these additional parameters:

* ``<element_name>.xmax`` (``float``, in meters) maximum value of the horizontal coordinate
* ``<element_name>.ymax`` (``float``, in meters) maximum value of the vertical coordinate
* ``<element_name>.aperture_x`` (``float``, in meters) horizontal half-aperture (elliptical or rectangular)
* ``<element_name>.aperture_y`` (``float``, in meters) vertical half-aperture (elliptical or rectangular)
* ``<element_name>.repeat_x`` (``float``, in meters) horizontal period for repeated aperture masking (inactive by default)
* ``<element_name>.repeat_y`` (``float``, in meters) vertical period for repeated aperture masking (inactive by default)
* ``<element_name>.shape`` (``string``) shape of the aperture boundary: ``rectangular`` (default) or ``elliptical``
Expand Down
Loading

0 comments on commit 7f8d15f

Please sign in to comment.