33 #include <boost/assign.hpp>
43 using namespace Options;
46 boost::assign::list_of<const boost::bimap<DumpFrame, std::string>::relation>
107 "The \"OPTION\" statement defines OPAL execution options.")
111 (
"ECHO",
"If true, give echo of input",
echo);
114 (
"INFO",
"If true, print information messages",
info);
117 (
"TRACE",
"If true, print execution trace"
118 "Must be the first option in the inputfile in "
119 "order to render correct results",
mtrace);
122 (
"WARN",
"If true, print warning messages",
warn);
125 (
"SEED",
"The seed for the random generator, -1 will use time(0) as seed ");
128 (
"TELL",
"If true, print the current settings. "
129 "Must be the last option in the inputfile in "
130 "order to render correct results",
false);
133 (
"PSDUMPFREQ",
"The frequency to dump the phase space, "
134 "i.e.dump data when step%psDumpFreq==0, its default value is 10.",
138 (
"STATDUMPFREQ",
"The frequency to dump statistical data "
139 "(e.g. RMS beam quantities), i.e. dump data when step%statDumpFreq == 0, "
143 (
"PSDUMPEACHTURN",
"If true, dump phase space after each "
144 "turn ,only aviable for OPAL-cycl, its default value is false",
148 (
"SCSOLVEFREQ",
"The frequency to solve space charge fields. its default value is 1");
151 (
"MTSSUBSTEPS",
"How many small timesteps "
152 "are inside the large timestep used in multiple "
153 "time stepping (MTS) integrator");
156 (
"REMOTEPARTDEL",
"Artifically delete the remote particle "
157 "if its distance to the beam mass is larger than "
158 "REMOTEPARTDEL times of the beam rms size, "
162 (
"PSDUMPFRAME",
"Controls the frame of phase space dump in "
163 "stat file and h5 file. If 'GLOBAL' OPAL will dump in the "
164 "lab (global) Cartesian frame; if 'BUNCH_MEAN' OPAL will "
165 "dump in the local Cartesian frame of the beam mean; "
166 "if 'REFERENCE' OPAL will dump in the local Cartesian "
167 "frame of the reference particle 0. Only available for "
168 "OPAL-cycl.", {
"BUNCH_MEAN",
"REFERENCE",
"GLOBAL"},
"GLOBAL");
171 (
"SPTDUMPFREQ",
"The frequency to dump single "
172 "particle trajectory of particles with ID = 0 & 1, "
176 (
"REPARTFREQ",
"The frequency to do particles repartition "
177 "for better load balance between nodes, its "
181 (
"MINBINEMITTED",
"The number of bins that have to be emitted before the bins are squashed into "
185 (
"MINSTEPFORREBIN",
"The number of steps into the simulation before the bins are squashed into "
189 (
"REBINFREQ",
"The frequency to reset energy bin ID for "
190 "all particles, its default value is 100.",
rebinFreq);
193 (
"RHODUMP",
"If true, in addition to the phase "
194 "space the scalar rho field is also dumped (H5Block)",
rhoDump);
197 (
"EBDUMP",
"If true, in addition to the phase space the "
198 "E and B field at each particle is also dumped into the H5 file)",
ebDump);
201 (
"CSRDUMP",
"If true, the csr E field, line density "
202 "and the line density derivative is dumped into the "
206 (
"AUTOPHASE",
"If greater than zero OPAL is scanning "
207 "the phases of each rf structure in order to get maximum "
208 "acceleration. Defines the number of refinements of the "
212 (
"CZERO",
"If set to true a symmetric distribution is "
213 "created -> centroid == 0.0",
cZero);
216 (
"RNGTYPE",
"Type of pseudo- or quasi-random number generator, "
217 "see also Quasi-Random Sequences, GSL reference manual.",
218 {
"RANDOM",
"HALTON",
"SOBOL",
"NIEDERREITER"},
rngtype);
221 (
"CLOTUNEONLY",
"If set to true stop after "
225 (
"NUMBLOCKS",
"Maximum number of vectors in the Krylov "
226 "space (for RCGSolMgr). Default value is 0 and BlockCGSolMgr will be used.");
229 (
"RECYCLEBLOCKS",
"Number of vectors in the recycle "
230 "space (for RCGSolMgr). Default value is 0 and BlockCGSolMgr will be used.");
233 (
"NLHS",
"Number of stored old solutions for extrapolating "
234 "the new starting vector. Default value is 1 and just the last solution is used.");
237 (
"ENABLEHDF5",
"If true, HDF5 actions are enabled",
enableHDF5);
240 (
"ENABLEVTK",
"If true, writing of VTK files are enabled",
enableVTK);
243 (
"ASCIIDUMP",
"If true, some of the elements dump in ASCII instead of HDF5",
asciidump);
246 (
"BOUNDPDESTROYFQ",
"The frequency to do boundp_destroy to "
250 (
"BEAMHALOBOUNDARY",
"Defines in terms of sigma where "
254 (
"IDEALIZED",
"Using the hard edge model for the calculation "
255 "of path length. Default: false",
idealized);
258 (
"LOGBENDTRAJECTORY",
"Writing the trajectory of "
262 (
"VERSION",
"Version of OPAL for which input file was written",
version);
266 (
"AMR",
"Use adaptive mesh refinement.",
amr);
269 "The frequency to dump grid "
274 "The frequency to perform a regrid "
275 "in multi-bunch mode (default: 10)",
280 (
"MEMORYDUMP",
"If true, write memory to SDDS file",
memoryDump);
283 (
"HALOSHIFT",
"Constant parameter to shift halo value (default: 0.0)",
haloShift);
286 (
"DELPARTFREQ",
"The frequency to delete particles, "
287 "i.e. delete when step%delPartFreq == 0. Default: 1",
delPartFreq);
290 (
"COMPUTEPERCENTILES",
"Flag to control whether the 68.27 "
291 "(1 sigma for normal distribution), the 95.45 (2 sigmas), "
292 "the 99.73 (3 sigmas) and the 99.994 (4 sigmas) percentiles "
293 "for the beam size and the normalized emittance should "
297 (
"DUMPBEAMMATRIX",
"Flag to control whether to write "
298 "the 6-dimensional beam matrix (upper triangle only) "
362 return new Option(name,
this);
403 IpplMemoryUsage::Unit::GB,
false);
467 if (
itsAttr[MINSTEPFORREBIN]) {
498 rngtype = std::string(
"RANDOM");
501 if (
itsAttr[BEAMHALOBOUNDARY]) {
517 *gmsg <<
"\nCurrent settings of options:\n" << *
this <<
endl;
535 for (
int i = 0; i <
SIZE; ++ i) {
536 itsAttr[i] = othersAttributes[i];
Attribute makeReal(const std::string &name, const std::string &help)
Make real attribute.
static OpalData * getInstance()
void handlePsDumpFrame(const std::string &dumpFrame)
int seed
The current random seed.
static std::string getDumpFrameString(const DumpFrame &df)
unsigned int delPartFreq
The frequency to delete particles (currently: OPAL-cycl only)
int main(int argc, char *argv[])
bool enableHDF5
If true HDF5 files are written.
void setReal(Attribute &attr, double val)
Set real value.
std::string getString(const Attribute &attr)
Get string value.
std::string rngtype
random number generator
int repartFreq
The frequency to do particles repartition for better load balance between nodes.
DumpFrame psDumpFrame
flag to decide in which coordinate frame the phase space will be dumped for OPAL-cycl ...
bool cZero
If true create symmetric distribution.
bool cloTuneOnly
Do closed orbit and tune calculation only.
int scSolveFreq
The frequency to solve space charge fields.
void init55(int seed)
Initialise random number generator.
virtual Option * clone(const std::string &name)
Make clone.
int amrRegridFreq
After how many steps the AMR grid hierarchy is updated.
static IpplMemory_p getInstance(Unit unit=Unit::GB, bool reset=true)
virtual void update()
Update this object.
bool writeBendTrajectories
bool enableVTK
If true VTK files are written.
Inform & endl(Inform &inf)
T::PETE_Expr_t::PETE_Return_t max(const PETE_Expr< T > &expr, NDIndex< D > &loc)
bool getBool(const Attribute &attr)
Return logical value.
Attribute makeBool(const std::string &name, const std::string &help)
Make logical attribute.
int numBlocks
RCG: cycle length.
void registerOwnership(const AttributeHandler::OwnerType &itsClass) const
Attribute makePredefinedString(const std::string &name, const std::string &help, const std::initializer_list< std::string > &predefinedStrings)
Make predefined string attribute.
int psDumpFreq
The frequency to dump the phase space, i.e.dump data when steppsDumpFreq==0.
bool psDumpEachTurn
phase space dump flag for OPAL-cycl
virtual void execute()
Execute the command.
void update(const std::vector< Attribute > &)
int minBinEmitted
The number of bins that have to be emitted before the bin are squashed into a single bin...
static const boost::bimap< DumpFrame, std::string > bmDumpFrameString_s
int sptDumpFreq
The frequency to dump single particle trajectory of particles with ID = 0 & 1.
void setPredefinedString(Attribute &attr, const std::string &val)
Set predefined string value.
int nLHS
number of old left hand sides used to extrapolate a new start vector
int minStepForRebin
The number of steps into the simulation before the bins are squashed into a single bin...
void setBool(Attribute &attr, bool val)
Set logical value.
static void setEcho(bool flag)
Set echo flag.
std::vector< Attribute > itsAttr
The object attributes.
bool amr
Enable AMR if true.
int recycleBlocks
RCG: number of recycle blocks.
double getReal(const Attribute &attr)
Return real value.
int version
opal version of input file
int rebinFreq
The frequency to reset energy bin ID for all particles.
Object * find(const std::string &name)
Find entry.
The base class for all OPAL actions.
int amrYtDumpFreq
The frequency to dump AMR grid data and particles into file.
int statDumpFreq
The frequency to dump statistical values, e.e. dump data when stepstatDumpFreq==0.
double haloShift
The constant parameter C to shift halo, by < w^4 > / < w^2 > ^2 - C (w=x,y,z)