33#include <boost/assign.hpp>
45 boost::assign::list_of<const boost::bimap<DumpFrame, std::string>::relation>
106 "The \"OPTION\" statement defines OPAL execution options.")
110 (
"ECHO",
"If true, give echo of input",
echo);
113 (
"INFO",
"If true, print information messages",
info);
116 (
"TRACE",
"If true, print execution trace"
117 "Must be the first option in the inputfile in "
118 "order to render correct results",
mtrace);
121 (
"WARN",
"If true, print warning messages",
warn);
124 (
"SEED",
"The seed for the random generator, -1 will use time(0) as seed ");
127 (
"TELL",
"If true, print the current settings. "
128 "Must be the last option in the inputfile in "
129 "order to render correct results",
false);
132 (
"PSDUMPFREQ",
"The frequency to dump the phase space, "
133 "i.e.dump data when step%psDumpFreq==0, its default value is 10.",
137 (
"STATDUMPFREQ",
"The frequency to dump statistical data "
138 "(e.g. RMS beam quantities), i.e. dump data when step%statDumpFreq == 0, "
142 (
"PSDUMPEACHTURN",
"If true, dump phase space after each "
143 "turn ,only aviable for OPAL-cycl, its default value is false",
147 (
"SCSOLVEFREQ",
"The frequency to solve space charge fields. its default value is 1");
150 (
"MTSSUBSTEPS",
"How many small timesteps "
151 "are inside the large timestep used in multiple "
152 "time stepping (MTS) integrator");
155 (
"REMOTEPARTDEL",
"Artifically delete the remote particle "
156 "if its distance to the beam mass is larger than "
157 "REMOTEPARTDEL times of the beam rms size, "
161 (
"PSDUMPFRAME",
"Controls the frame of phase space dump in "
162 "stat file and h5 file. If 'GLOBAL' OPAL will dump in the "
163 "lab (global) Cartesian frame; if 'BUNCH_MEAN' OPAL will "
164 "dump in the local Cartesian frame of the beam mean; "
165 "if 'REFERENCE' OPAL will dump in the local Cartesian "
166 "frame of the reference particle 0. Only available for "
167 "OPAL-cycl.", {
"BUNCH_MEAN",
"REFERENCE",
"GLOBAL"},
"GLOBAL");
170 (
"SPTDUMPFREQ",
"The frequency to dump single "
171 "particle trajectory of particles with ID = 0 & 1, "
175 (
"REPARTFREQ",
"The frequency to do particles repartition "
176 "for better load balance between nodes, its "
180 (
"MINBINEMITTED",
"The number of bins that have to be emitted before the bins are squashed into "
184 (
"MINSTEPFORREBIN",
"The number of steps into the simulation before the bins are squashed into "
188 (
"REBINFREQ",
"The frequency to reset energy bin ID for "
189 "all particles, its default value is 100.",
rebinFreq);
192 (
"RHODUMP",
"If true, in addition to the phase "
193 "space the scalar rho field is also dumped (H5Block)",
rhoDump);
196 (
"EBDUMP",
"If true, in addition to the phase space the "
197 "E and B field at each particle is also dumped into the H5 file)",
ebDump);
200 (
"CSRDUMP",
"If true, the csr E field, line density "
201 "and the line density derivative is dumped into the "
205 (
"AUTOPHASE",
"If greater than zero OPAL is scanning "
206 "the phases of each rf structure in order to get maximum "
207 "acceleration. Defines the number of refinements of the "
211 (
"CZERO",
"If set to true a symmetric distribution is "
212 "created -> centroid == 0.0",
cZero);
215 (
"RNGTYPE",
"Type of pseudo- or quasi-random number generator, "
216 "see also Quasi-Random Sequences, GSL reference manual.",
217 {
"RANDOM",
"HALTON",
"SOBOL",
"NIEDERREITER"},
rngtype);
220 (
"CLOTUNEONLY",
"If set to true stop after "
224 (
"NUMBLOCKS",
"Maximum number of vectors in the Krylov "
225 "space (for RCGSolMgr). Default value is 0 and BlockCGSolMgr will be used.");
228 (
"RECYCLEBLOCKS",
"Number of vectors in the recycle "
229 "space (for RCGSolMgr). Default value is 0 and BlockCGSolMgr will be used.");
232 (
"NLHS",
"Number of stored old solutions for extrapolating "
233 "the new starting vector. Default value is 1 and just the last solution is used.");
236 (
"ENABLEHDF5",
"If true, HDF5 actions are enabled",
enableHDF5);
239 (
"ENABLEVTK",
"If true, writing of VTK files are enabled",
enableVTK);
242 (
"ASCIIDUMP",
"If true, some of the elements dump in ASCII instead of HDF5",
asciidump);
245 (
"BOUNDPDESTROYFQ",
"The frequency to do boundp_destroy to "
249 (
"BEAMHALOBOUNDARY",
"Defines in terms of sigma where "
253 (
"IDEALIZED",
"Using the hard edge model for the calculation "
254 "of path length. Default: false",
idealized);
257 (
"LOGBENDTRAJECTORY",
"Writing the trajectory of "
261 (
"VERSION",
"Version of OPAL for which input file was written",
version);
265 (
"AMR",
"Use adaptive mesh refinement.",
amr);
268 "The frequency to dump grid "
273 "The frequency to perform a regrid "
274 "in multi-bunch mode (default: 10)",
279 (
"MEMORYDUMP",
"If true, write memory to SDDS file",
memoryDump);
282 (
"HALOSHIFT",
"Constant parameter to shift halo value (default: 0.0)",
haloShift);
285 (
"DELPARTFREQ",
"The frequency to delete particles, "
286 "i.e. delete when step%delPartFreq == 0. Default: 1",
delPartFreq);
289 (
"COMPUTEPERCENTILES",
"Flag to control whether the 68.27 "
290 "(1 sigma for normal distribution), the 95.45 (2 sigmas), "
291 "the 99.73 (3 sigmas) and the 99.994 (4 sigmas) percentiles "
292 "for the beam size and the normalized emittance should "
296 (
"DUMPBEAMMATRIX",
"Flag to control whether to write "
297 "the 6-dimensional beam matrix (upper triangle only) "
402 IpplMemoryUsage::Unit::GB,
false);
464 if (
itsAttr[MINSTEPFORREBIN]) {
495 rngtype = std::string(
"RANDOM");
498 if (
itsAttr[BEAMHALOBOUNDARY]) {
514 *
gmsg <<
"\nCurrent settings of options:\n" << *
this <<
endl;
532 for (
int i = 0; i <
SIZE; ++ i) {
533 itsAttr[i] = othersAttributes[i];
int main(int argc, char *argv[])
T::PETE_Expr_t::PETE_Return_t max(const PETE_Expr< T > &expr, NDIndex< D > &loc)
Inform & endl(Inform &inf)
Some AMR types used a lot.
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.
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.
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 amrRegridFreq
After how many steps the AMR grid hierarchy is updated.
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.
int amrYtDumpFreq
The frequency to dump AMR grid data and particles into file.
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.
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.
The base class for all OPAL actions.
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.
static const boost::bimap< DumpFrame, std::string > bmDumpFrameString_s
virtual void update()
Update this object.
void handlePsDumpFrame(const std::string &dumpFrame)
virtual Option * clone(const std::string &name)
Make clone.
static std::string getDumpFrameString(const DumpFrame &df)
static void setEcho(bool flag)
Set echo flag.
void init55(int seed)
Initialise random number generator.
static IpplMemory_p getInstance(Unit unit=Unit::GB, bool reset=true)