The OPAL Framework (Object Oriented Parallel Accelerator Library) Version 1.1.9 User's Reference Manual
Total Page:16
File Type:pdf, Size:1020Kb
PSI-PR-08-02 The OPAL Framework (Object Oriented Parallel Accelerator Library) Version 1.1.91 User’s Reference Manual Andreas Adelmann, Achim Gsell, Christof Kraus (PSI) Yves Ineichen (IBM), Steve Russell (LANL), Yuanjie Bi, Chuan Wang, Jianjun Yang (CIAE), Hao Zha (Thinghua University) Suzanne Sheehy, Chris Rogers (RAL) and Christopher Mayes (Cornell) Abstract OPAL is a tool for charged-particle optics in accelerator structures and beam lines. Using the MAD language with extensions, OPAL is derived from MAD9P and is based on the CLASSIC class library, which was started in 1995 by an international collaboration. IPPL (Independent Parallel Par- ticle Layer) is the framework which provides parallel particles and fields using data parallel ansatz. OPAL is built from the ground up as a parallel application exemplifying the fact that HPC (High Performance Computing) is the third leg of science, complementing theory and the experiment. HPC is made possible now through the increasingly sophisticated mathematical models and evolving com- puter power available on the desktop and in super computer centres. OPAL runs on your laptop as well as on the largest HPC clusters available today. The OPAL framework makes it easy to add new features in the form of new C++ classes. It comes in the following flavours: OPAL-CYCL tracks particles with 3D space charge including neighbouring turns in cyclotrons with time as the independent variable. OPAL-T is a superset of IMPACT-T [40] and can be used to model guns, injectors and complete XFEL’s excluding the undulator. It should be noted that not all features of OPAL are available in all flavours. The icon DOPAL-T means that a feature is not yet available in OPAL-T . Similar icons are used for the other flavours. 1Release Date: February 13, 2013 2 Contents 1 Introduction 13 1.1 Aim of OPAL and History...................................... 13 1.2 Parallel Processing Capabilities.................................... 13 1.3 Quality Management......................................... 14 1.4 Field Maps from the Femaxx 3D Eigenmode Solver......................... 15 1.5 Output................................................. 16 1.6 Acknowledgements.......................................... 17 1.7 Citation................................................ 17 2 Conventions 19 2.1 Physical Units............................................. 19 3 Tutorial 21 3.1 Starting OPAL............................................. 21 3.2 Restart Mode............................................. 21 3.3 Autophase Example.......................................... 21 3.4 Examples of Beam Lines....................................... 22 3.4.1 PSI XFEL 250 MeV Injector................................. 23 3.4.2 PSI Injector II Cyclotron................................... 24 3.4.3 PSI Ring Cyclotron...................................... 28 4 OPAL-T 31 4.1 Introduction.............................................. 31 4.2 Variables in OPAL-T ......................................... 31 4.3 Integration of the Equation of Motion................................ 32 4.4 Envelope Tracker........................................... 32 4.5 Space Charge............................................. 32 4.6 Wake Fields.............................................. 33 4.7 Multiple Species........................................... 33 5 OPAL-CYCL 35 5.1 Introduction.............................................. 35 5.2 Tracking modes............................................ 35 5.2.1 Single Particle Tracking mode................................ 35 5.2.2 Tune Calculation mode.................................... 36 5.2.3 Multi-particle tracking mode................................. 36 5.3 Variables in OPAL-CYCL ....................................... 36 5.3.1 The initial distribution in the local reference frame..................... 37 5.4 Field Maps.............................................. 37 5.4.1 CARBONCYCL type.................................... 38 3 4 CONTENTS 5.4.2 CYCIAE type......................................... 39 5.4.3 BANDRF type........................................ 40 5.4.4 Default PSI format...................................... 40 5.4.5 user’s own fieldmap..................................... 40 5.5 RF field................................................ 41 5.5.1 Read RF voltage profile................................... 41 5.5.2 Read 3D RF fieldmap.................................... 41 5.6 Particle Tracking and Acceleration.................................. 41 5.7 Space Charge............................................. 41 5.8 Multi-bunches Issues......................................... 42 5.9 Input.................................................. 42 5.10 Output................................................. 43 6 Command Format 45 6.1 Statements and Comments...................................... 45 6.2 Identifiers or Labels.......................................... 46 6.3 Command Attribute Types...................................... 46 6.4 String Attributes............................................ 47 6.5 Logical Expressions.......................................... 48 6.6 Real Expressions........................................... 49 6.7 Operators............................................... 50 6.8 Operands in Expressions....................................... 52 6.8.1 Literal Constants....................................... 52 6.8.2 Symbolic constants...................................... 52 6.8.3 Variable labels........................................ 52 6.8.4 Element or command attributes............................... 53 6.8.5 Deferred Expressions and Random Values.......................... 53 6.8.6 Table References....................................... 54 6.9 Element Selection........................................... 54 6.9.1 Element Selection...................................... 54 6.9.2 Range Selection....................................... 55 6.10 Constraints.............................................. 56 6.11 Variable Names............................................ 56 6.12 Regular Expressions......................................... 56 6.13 Token List............................................... 57 6.14 Arrays................................................. 57 6.14.1 Logical Arrays........................................ 57 6.14.2 Real Arrays.......................................... 57 6.14.3 String Arrays......................................... 60 6.14.4 Token List Arrays....................................... 60 7 Control Statements 61 7.1 Getting Help.............................................. 61 7.1.1 HELP Command....................................... 61 7.1.2 SHOW Command...................................... 61 7.1.3 WHAT Command...................................... 62 7.2 STOP / QUIT Statement....................................... 62 7.3 OPTION Statement.......................................... 62 7.4 Parameter Statements......................................... 64 7.4.1 Variable Definitions..................................... 64 7.4.2 Symbolic Constants..................................... 66 CONTENTS 5 7.4.3 Vector Values......................................... 66 7.4.4 Assignment to Variables................................... 67 7.4.5 VALUE: Output of Expressions............................... 67 7.4.6 H5merge........................................... 68 7.5 Miscellaneous Commands...................................... 68 7.5.1 ECHO Statement....................................... 68 7.5.2 SYSTEM: Execute System Command............................ 68 7.5.3 SYSTEM Command under UNIX.............................. 68 7.6 TITLE Statement........................................... 69 7.7 File Handling............................................. 69 7.7.1 CALL Statement....................................... 69 7.7.2 SAVE Statement....................................... 69 7.7.3 MAKESEQ Statement.................................... 69 7.8 IF: Conditional Execution....................................... 70 7.9 WHILE: Repeated Execution..................................... 70 7.10 MACRO: Macro Statements (Subroutines).............................. 70 8 Elements 73 8.1 Element Input Format......................................... 73 8.2 Common Attributes for all Elements................................. 73 8.3 Drift Spaces.............................................. 75 8.4 Bending Magnets........................................... 76 8.5 Quadrupole.............................................. 80 8.6 Sextupole............................................... 81 8.7 Octupole................................................ 81 8.8 General Multipole........................................... 81 8.9 Solenoid................................................ 83 8.10 Cyclotron............................................... 84 8.11 RF Cavities (OPAL-T and OPAL-CYCL).............................. 86 8.11.1 OPAL-Tmode........................................ 86 8.11.2 OPAL-CYCLmode...................................... 86 8.12 Traveling Wave Structure....................................... 88 8.13 Monitors................................................ 89 8.14 Collimators.............................................. 91 8.14.1 OPAL-Tmode........................................ 91 8.14.2 OPAL-CYCLmode...................................... 92 8.15 Septum (OPAL-CYCL)........................................ 93 8.16 Probe (OPAL-CYCL)......................................... 93 8.17 Stripper (OPAL-CYCL).......................................