How to add an Element

Lets assume you need to add a new element (Interaction Point — IC) to OPALX.

Within 5 steps a new element is added to OPALX. Six new files are created Ip.{h,cpp}, IpRep.{h,cpp} and OpalIp.{h,cpp}. A good practice is to search for an element with similar attributes, for this case a Drift will do the trick.

  1. ‎src/AbsBeamline: CMakeLists.txt, BeamlineVisitor.h, Ip.{h,cpp}, ElementBase.{h,cpp}, SpecificElementVisitor.h‎

  2. src/Alogorithms: DefaultVisitor.{h,cpp}, ParallelTracker.h

  3. src/BeamlineCore: CMakeLists.txt, IpRep.{h,cpp}

  4. src/Elements: CMakeLists.txt, OpalIp.{h,cpp}

  5. src/OpalConfigure: Configure.cpp

Most Used Directories

  • src/Algorithms ParallelTracker

  • src/Distribution particle distribution

  • src/Elements parser part for the elements

  • src/OpalParser parser

  • src/Optimize parser part for the optimizer

  • src/Sample parser part and bit more for the sampler

  • src/Solvers field solvers, CSR and wake field solvers

  • src/Steppers stepper algorithms, e.g. RK, Boris

  • src/Structure classes for output

  • src/Classic/AbsBeamline element definitions

  • src/Classic/Algorithms particle bunch

  • src/Classic/BeamlineCore wrappers for the elements

  • src/Classic/Fields field maps

  • src/Classic/Filters filters for CSR and geometric wake field

  • src/Classic/Parser low level parser

  • src/Classic/Physics physical constants and material definitions

  • src/Classic/TrimCoils definitions for trim coils

  • optimizer low level optimizer library

  • ippl low level library for grids, fft, particles, output

The source code documentation based on Doxygen shows the details.