30#include "Utility/Inform.h"
31#include "Utility/IpplInfo.h"
97 AGGRESSIVE_STATE_SYNC,
103 :
Action(
SIZE,
"OPTION",
"The \"OPTION\" statement defines OPAL execution options.") {
110 "If true, print execution trace"
111 "Must be the first option in the inputfile in "
112 "order to render correct results",
118 "SEED",
"The seed for the random generator, -1 will use time(0) as seed ");
122 "If true, print the current settings. "
123 "Must be the last option in the inputfile in "
124 "order to render correct results",
129 "The frequency to dump the phase space, "
130 "i.e.dump data when step%psDumpFreq==0, its default value is 10.",
135 "The frequency to dump statistical data "
136 "(e.g. RMS beam quantities), i.e. dump data when step%statDumpFreq == 0, "
137 "its default value is 10.",
142 "The frequency to print per-step tracking status lines. "
143 "A value of 0 disables these status lines; its default value is 1.",
148 "If true, dump phase space after each "
149 "turn ,only aviable for OPAL-cycl, its default value is false",
153 "SCSOLVEFREQ",
"The frequency to solve space charge fields. its default value is 1");
157 "How many small timesteps "
158 "are inside the large timestep used in multiple "
159 "time stepping (MTS) integrator");
163 "Artifically delete the remote particle "
164 "if its distance to the beam mass is larger than "
165 "REMOTEPARTDEL times of the beam rms size, "
166 "its default values is 0 (no delete) ",
171 "Controls the frame of phase space dump in "
172 "stat file and h5 file. If 'GLOBAL' OPAL will dump in the "
173 "lab (global) Cartesian frame; if 'BUNCH_MEAN' OPAL will "
174 "dump in the local Cartesian frame of the beam mean; "
175 "if 'REFERENCE' OPAL will dump in the local Cartesian "
176 "frame of the reference particle 0. Only available for "
178 {
"BUNCH_MEAN",
"REFERENCE",
"GLOBAL"},
"GLOBAL");
182 "The frequency to dump single "
183 "particle trajectory of particles with ID = 0 & 1, "
184 "its default value is 1.",
189 "The frequency to do particles repartition "
190 "for better load balance between nodes, its "
197 "The number of bins that have to be emitted before the bins are squashed into "
198 "a single bin; the default value is "
204 "The number of steps into the simulation before the bins are squashed into "
205 "a single bin; the default value is "
211 "The frequency to reset energy bin ID for "
212 "all particles, its default value is 100.",
217 "If true, in addition to the phase "
218 "space the scalar rho field is also dumped (H5Block)",
223 "If true, in addition to the phase space the "
224 "E and B field at each particle is also dumped into the H5 file)",
229 "If true, the csr E field, line density "
230 "and the line density derivative is dumped into the "
236 "If greater than zero OPAL is scanning "
237 "the phases of each rf structure in order to get maximum "
238 "acceleration. Defines the number of refinements of the "
244 "If set to true a symmetric distribution is "
245 "created -> centroid == 0.0",
250 "Type of pseudo- or quasi-random number generator, "
251 "see also Quasi-Random Sequences, GSL reference manual.",
252 {
"RANDOM",
"HALTON",
"SOBOL",
"NIEDERREITER"},
rngtype);
256 "If set to true stop after "
257 "CLO and tune calculation ",
262 "Maximum number of vectors in the Krylov "
263 "space (for RCGSolMgr). Default value is 0 and BlockCGSolMgr will be used.");
267 "Number of vectors in the recycle "
268 "space (for RCGSolMgr). Default value is 0 and BlockCGSolMgr will be used.");
272 "Number of stored old solutions for extrapolating "
273 "the new starting vector. Default value is 1 and just the last solution is used.");
279 "ENABLEVTK",
"If true, writing of VTK files are enabled",
enableVTK);
282 "ASCIIDUMP",
"If true, some of the elements dump in ASCII instead of HDF5",
asciidump);
286 "The number of sigmas away from the mean "
287 "at which particles are deleted. Default 10",
292 "Defines in terms of sigma where "
293 "the halo starts. Default 0.0",
298 "Using the hard edge model for the calculation "
299 "of path length. Default: false",
304 "Writing the trajectory of "
305 "every bend to disk. Default: false",
309 "VERSION",
"Version of OPAL for which input file was written",
version);
315 "HALOSHIFT",
"Constant parameter to shift halo value (default: 0.0)",
haloShift);
319 "The frequency to delete particles, "
320 "i.e. delete when step%delPartFreq == 0. Default: 1",
324 "COMPUTEPERCENTILES",
325 "Flag to control whether the 68.27 "
326 "(1 sigma for normal distribution), the 95.45 (2 sigmas), "
327 "the 99.73 (3 sigmas) and the 99.994 (4 sigmas) percentiles "
328 "for the beam size and the normalized emittance should "
329 "be computed. Default: false",
334 "Storage mode for particle charge/mass. "
335 "SINGLE uses one shared value per container; "
336 "ATTRIBUTES stores per-particle values (accessible via per-particle "
341 "AGGRESSIVE_STATE_SYNC",
342 "If true, every mutation of the shared BunchStateHandler flags "
343 "(moments-dirty, unitless-positions, emitting-now, first-repartition) "
344 "performs an MPI allreduce so that all ranks converge to the same "
345 "value. Guards against rank-local divergence at the cost of an extra "
346 "collective on every state change. Default: false.",
427 if (qmMode ==
"ATTRIBUTES") {
429 }
else if (qmMode ==
"SINGLE") {
434 "Unsupported QM_MODE '" + qmMode +
"'. Use \"SINGLE\" or \"ATTRIBUTES\".");
501 if (
itsAttr[MINSTEPFORREBIN]) {
543 rngtype = std::string(
"RANDOM");
546 if (
itsAttr[BEAMHALOBOUNDARY]) {
561 *
gmsg <<
"\nCurrent settings of options:\n" << *
this << endl;
579 for (
int i = 0; i <
SIZE; ++i) {
580 itsAttr[i] = othersAttributes[i];
int main(int argc, char *argv[])
The base class for all OPAL actions.
Simple bidirectional map with lookup in both directions.
void insert(const Left &left, const Right &right)
Insert or overwrite a left/right association.
right_view right
Right view accessor.
left_view left
Left view accessor.
static void setEcho(bool flag)
Set echo flag.
void registerOwnership(const AttributeHandler::OwnerType &itsClass) const
std::vector< Attribute > itsAttr
The object attributes.
Object * find(const std::string &name)
Find entry.
static OpalData * getInstance()
virtual void execute()
Execute the command.
void update(const std::vector< Attribute > &)
virtual void update()
Update this object.
void handlePsDumpFrame(const std::string &dumpFrame)
static const BiMap< DumpFrame, std::string > bmDumpFrameString_s
virtual Option * clone(const std::string &name)
Make clone.
static std::string getDumpFrameString(const DumpFrame &df)
void init55(int seed)
Initialise random number generator.
Attribute makeBool(const std::string &name, const std::string &help)
Make logical attribute.
double getReal(const Attribute &attr)
Return real value.
void setBool(Attribute &attr, bool val)
Set logical value.
Attribute makePredefinedString(const std::string &name, const std::string &help, const std::initializer_list< std::string > &predefinedStrings)
Make predefined string attribute.
Attribute makeReal(const std::string &name, const std::string &help)
Make real attribute.
void setString(Attribute &attr, const std::string &val)
Set string value.
bool getBool(const Attribute &attr)
Return logical value.
void setReal(Attribute &attr, double val)
Set real value.
void setPredefinedString(Attribute &attr, const std::string &val)
Set predefined string value.
std::string getString(const Attribute &attr)
Get string value.
Attribute makeString(const std::string &name, const std::string &help)
Make string attribute.
int stepInfoFreq
The frequency to print per-step tracking status lines; 0 disables them.
int psDumpFreq
The frequency to dump the phase space, i.e.dump data when steppsDumpFreq==0.
double haloShift
The constant parameter C to shift halo, by < w^4 > / < w^2 > ^2 - C (w=x,y,z)
bool writeBendTrajectories
bool enableVTK
If true VTK files are written.
int version
opal version of input file
int minBinEmitted
The number of bins that have to be emitted before the bin are squashed into a single bin.
bool enableHDF5
If true HDF5 files are written.
bool psDumpEachTurn
phase space dump flag for OPAL-cycl
int numBlocks
RCG: cycle length.
int sptDumpFreq
The frequency to dump single particle trajectory of particles with ID = 0 & 1.
std::string rngtype
random number generator
int minStepForRebin
The number of steps into the simulation before the bins are squashed into a single bin.
bool cloTuneOnly
Do closed orbit and tune calculation only.
unsigned int delPartFreq
The frequency to delete particles (currently: OPAL-cycl only)
int scSolveFreq
The frequency to solve space charge fields.
int repartFreq
The frequency to do particles repartition for better load balance between nodes.
bool cZero
If true create symmetric distribution.
int nLHS
number of old left hand sides used to extrapolate a new start vector
int rebinFreq
The frequency to reset energy bin ID for all particles.
double boundpDestroy
Governs how many sigmas away particles are deleted.
int seed
The current random seed.
DumpFrame psDumpFrame
flag to decide in which coordinate frame the phase space will be dumped for OPAL-cycl
int statDumpFreq
The frequency to dump statistical values, e.e. dump data when stepstatDumpFreq==0.
int recycleBlocks
RCG: number of recycle blocks.