OPAL (Object Oriented Parallel Accelerator Library)  2024.1
OPAL
Options.h
Go to the documentation of this file.
1 //
2 // Namespace Options
3 // The global OPAL option flags.
4 // This namespace contains the global option flags.
5 //
6 // Copyright (c) 200x - 2020, Paul Scherrer Institut, Villigen PSI, Switzerland
7 // All rights reserved
8 //
9 // This file is part of OPAL.
10 //
11 // OPAL is free software: you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation, either version 3 of the License, or
14 // (at your option) any later version.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with OPAL. If not, see <https://www.gnu.org/licenses/>.
18 //
19 #ifndef OPTIONS_HH
20 #define OPTIONS_HH
21 
23 
24 #include <string>
25 
26 enum class DumpFrame: unsigned short {
27  GLOBAL,
28  BUNCH_MEAN,
29  REFERENCE
30 };
31 
32 namespace Options {
34  // If true, print an input echo.
35  extern bool echo;
36 
38  // If true, print informative messages.
39  extern bool info;
40  extern int infoLevel;
41 
43  // If true, print CPU time before and after each command.
44  extern bool mtrace;
45 
47  // If true, print warning messages.
48  extern bool warn;
49  extern int warnLevel;
50 
51  // The global random generator.
52  extern Random rangen;
53 
55  extern int seed;
56 
58  extern int psDumpFreq;
59 
61  extern int statDumpFreq;
62 
64  // if true, dump phase space after each turn
65  extern bool psDumpEachTurn;
66 
68  // - GLOBAL, in Cartesian frame of the global particle
69  // - BUNCH_MEAN, in Cartesian frame of the bunch mean
70  // - REFERENCE, in Cartesian frame of the reference (0) particle
71  extern DumpFrame psDumpFrame;
72 
74  extern int sptDumpFreq;
75 
77  extern int repartFreq;
78 
80  extern int minBinEmitted;
81 
83  extern int minStepForRebin;
84 
86  extern int rebinFreq;
87 
89  extern int scSolveFreq;
90 
91  // How many small timesteps are inside the large timestep used in multiple time stepping (MTS) integrator
92  extern int mtsSubsteps;
93 
94  // If the distance of a particle to bunch mass larger than remotePartDel times of the rms size of the bunch in any dimension,
95  // the particle will be deleted artifically to hold the accuracy of space charge calculation. The default setting of -1 stands for no deletion.
96  extern double remotePartDel;
97 
98  extern bool rhoDump;
99 
100  extern bool ebDump;
101 
102  extern bool csrDump;
103 
104  // the number of refinements of the search range for the phase with maximum energy
105  // if eq 0 then no autophase
106  // if true opal find the phases in the cavities, such that the energy gain is at maximum
107  extern int autoPhase;
108 
109  // Options for the Belos solver
111  extern int numBlocks;
113  extern int recycleBlocks;
115  extern int nLHS;
116 
118  extern bool cZero;
119 
121  extern std::string rngtype;
122 
124  extern bool enableHDF5;
125 
127  extern bool enableVTK;
128 
129  extern bool asciidump;
130 
131  // Governs how often boundp_destroy is called to destroy lost particles
132  // Mainly used in the CyclotronTracker as of now -DW
133  extern int boundpDestroyFreq;
134 
135  extern double beamHaloBoundary;
136 
138  extern bool cloTuneOnly;
139 
140  // Using hard edge model for calculation of path length
141  extern bool idealized;
142 
143  extern bool writeBendTrajectories;
144 
146  extern int version;
147 
149  extern bool amr;
150 
152  extern int amrYtDumpFreq;
153 
155  extern int amrRegridFreq;
156 
157  extern bool memoryDump;
158 
160  extern double haloShift;
161 
163  extern unsigned int delPartFreq;
164 
165  extern bool computePercentiles;
166 
167  extern bool dumpBeamMatrix;
168 
169 }
170 
171 #endif // OPAL_Options_HH
bool dumpBeamMatrix
Definition: Options.cpp:113
int seed
The current random seed.
Definition: Options.cpp:37
unsigned int delPartFreq
The frequency to delete particles (currently: OPAL-cycl only)
Definition: Options.cpp:109
bool enableHDF5
If true HDF5 files are written.
Definition: Options.cpp:81
int mtsSubsteps
Definition: Options.cpp:59
std::string rngtype
random number generator
Definition: Options.cpp:79
int repartFreq
The frequency to do particles repartition for better load balance between nodes.
Definition: Options.cpp:49
DumpFrame psDumpFrame
flag to decide in which coordinate frame the phase space will be dumped for OPAL-cycl ...
Definition: Options.cpp:45
bool echo
Echo flag.
Definition: Options.cpp:26
bool cZero
If true create symmetric distribution.
Definition: Options.cpp:77
Random rangen
Definition: Options.cpp:36
bool cloTuneOnly
Do closed orbit and tune calculation only.
Definition: Options.cpp:91
bool asciidump
Definition: Options.cpp:85
int scSolveFreq
The frequency to solve space charge fields.
Definition: Options.cpp:57
bool memoryDump
Definition: Options.cpp:105
int amrRegridFreq
After how many steps the AMR grid hierarchy is updated.
Definition: Options.cpp:103
bool writeBendTrajectories
Definition: Options.cpp:95
bool enableVTK
If true VTK files are written.
Definition: Options.cpp:83
bool info
Info flag.
Definition: Options.cpp:28
bool ebDump
Definition: Options.cpp:65
bool idealized
Definition: Options.cpp:93
bool csrDump
Definition: Options.cpp:67
int numBlocks
RCG: cycle length.
Definition: Options.cpp:71
int autoPhase
Definition: Options.cpp:69
int psDumpFreq
The frequency to dump the phase space, i.e.dump data when steppsDumpFreq==0.
Definition: Options.cpp:39
bool psDumpEachTurn
phase space dump flag for OPAL-cycl
Definition: Options.cpp:43
int minBinEmitted
The number of bins that have to be emitted before the bin are squashed into a single bin...
Definition: Options.cpp:51
int boundpDestroyFreq
Definition: Options.cpp:87
int sptDumpFreq
The frequency to dump single particle trajectory of particles with ID = 0 &amp; 1.
Definition: Options.cpp:47
int nLHS
number of old left hand sides used to extrapolate a new start vector
Definition: Options.cpp:75
int minStepForRebin
The number of steps into the simulation before the bins are squashed into a single bin...
Definition: Options.cpp:53
bool amr
Enable AMR if true.
Definition: Options.cpp:99
int recycleBlocks
RCG: number of recycle blocks.
Definition: Options.cpp:73
DumpFrame
Definition: Options.h:26
bool computePercentiles
Definition: Options.cpp:111
int version
opal version of input file
Definition: Options.cpp:97
bool mtrace
Trace flag.
Definition: Options.cpp:31
double remotePartDel
Definition: Options.cpp:61
int infoLevel
Definition: Options.cpp:29
int rebinFreq
The frequency to reset energy bin ID for all particles.
Definition: Options.cpp:55
bool rhoDump
Definition: Options.cpp:63
bool warn
Warn flag.
Definition: Options.cpp:33
double beamHaloBoundary
Definition: Options.cpp:89
int amrYtDumpFreq
The frequency to dump AMR grid data and particles into file.
Definition: Options.cpp:101
int warnLevel
Definition: Options.cpp:34
int statDumpFreq
The frequency to dump statistical values, e.e. dump data when stepstatDumpFreq==0.
Definition: Options.cpp:41
double haloShift
The constant parameter C to shift halo, by &lt; w^4 &gt; / &lt; w^2 &gt; ^2 - C (w=x,y,z)
Definition: Options.cpp:107
The CLASSIC random generator.
Definition: ClassicRandom.h:36