How to add an Element
Lets assume you need to add a new element (Interaction Point — IC) to OPALX.
-
A good start is adding the documentation first i.e. https://opalx-project.github.io/Manual/
-
Make an Issue (https://github.com/OPALX-project/OPALX/issues/271) and a Pull request
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.
-
src/AbsBeamline: CMakeLists.txt, BeamlineVisitor.h, Ip.{h,cpp}, ElementBase.{h,cpp}, SpecificElementVisitor.h
-
src/Alogorithms: DefaultVisitor.{h,cpp}, ParallelTracker.h
-
src/BeamlineCore: CMakeLists.txt, IpRep.{h,cpp}
-
src/Elements: CMakeLists.txt, OpalIp.{h,cpp}
-
src/OpalConfigure: Configure.cpp
Most Used Directories
-
src/AlgorithmsParallelTracker -
src/Distributionparticle distribution -
src/Elementsparser part for the elements -
src/OpalParserparser -
src/Optimizeparser part for the optimizer -
src/Sampleparser part and bit more for the sampler -
src/Solversfield solvers, CSR and wake field solvers -
src/Steppersstepper algorithms, e.g. RK, Boris -
src/Structureclasses for output -
src/Classic/AbsBeamlineelement definitions -
src/Classic/Algorithmsparticle bunch -
src/Classic/BeamlineCorewrappers for the elements -
src/Classic/Fieldsfield maps -
src/Classic/Filtersfilters for CSR and geometric wake field -
src/Classic/Parserlow level parser -
src/Classic/Physicsphysical constants and material definitions -
src/Classic/TrimCoilsdefinitions for trim coils -
optimizerlow level optimizer library -
ippllow level library for grids, fft, particles, output
The source code documentation based on Doxygen shows the details.