Commit c2ea9094 authored by adelmann's avatar adelmann 🎗

Unifiy OpalOptions and Options and set more defaults

parent 79b0468f
#include "Utilities/Random.h"
#include <string>
namespace Options {
// The global program options.
......@@ -9,7 +11,6 @@ namespace Options {
// If true create symmetric distribution
bool cZero = false;
bool enableHDF5 = true;
bool asciidump = false;
// If the distance of a particle to bunch mass larger than remotePartDel times of the rms size of the bunch in any dimension,
......@@ -17,4 +18,72 @@ namespace Options {
int remotePartDel = -1;
double beamHaloBoundary = 0;
// The global program options.
bool mtrace = false;
bool verify = false;
bool warn = true;
bool psDumpEachTurn = false;
bool psDumpLocalFrame = false;
bool scan = false;
bool rhoDump = false;
bool ebDump = false;
bool enableHDF5 = true;
// bool efDump = false;
// The global random generator.
Random rangen;
// The current random seed.
int seed = 123456789;
// the number of refinements of the search range for the phase with maximum energy
// if eq 0 then no autophase
int autoPhase = 0;
// The frequency to dump the phase space, i.e.dump data when step%psDumpFreq==0
int psDumpFreq = 10;
// // The frequency to dump the phase space, i.e.dump data when step%psDumpFreq==0
// double rDump = 0.0;
// The frequency to dump statistical quantities such as beam RMS properties, i.e. dump
// when step%statDumpFreq == 0.
int statDumpFreq = 10;
// The frequency to dump single particle trajectory of particles with ID = 0 & 1
int sptDumpFreq = 1;
// The frequency to do particles repartition for better load balance between nodes
int repartFreq = 10;
// The frequency to reset energy bin ID for all particles
int rebinFreq = 100;
/// The frequency to solve space charge fields.
int scSolveFreq = 1;
// How many small timesteps are inside the large timestep used in multiple time stepping (MTS) integrator
int mtsSubsteps = 1;
// The frequency to dump the particle-geometry surface interation data, -1 stands for no dump.
int surfDumpFreq = -1;
// Options for the Belos solver
int numBlocks = 0;
int recycleBlocks = 0;
int nLHS = 1;
std::string rngtype = std::string("RANDOM");
bool schottkyCorrection = false;
double schottkyRennormalization = -1;
bool cloTuneOnly;
// Governs how often boundp_destroy is called to destroy lost particles
// Mainly used in the CyclotronTracker as of now -DW
int boundpDestroyFreq = 10;
}
......@@ -24,6 +24,8 @@
/// The global OPAL option flags.
// This namespace contains the global option flags.
#include "Utilities/Random.h"
namespace Options {
/// Echo flag.
......@@ -53,6 +55,108 @@ namespace Options {
extern double remotePartDel;
extern double beamHaloBoundary;
// CKR: nowhere used
// // true if in bet mode
// extern bool bet;
/// Trace flag.
// If true, print CPU time before and after each command.
extern bool mtrace;
/// Verify flag.
// If true, print warning about undefined variables.
extern bool verify;
/// Warn flag.
// If true, print warning messages.
extern bool warn;
/// Random generator.
// The global random generator.
extern Random rangen;
/// The current random seed.
extern int seed;
/// The frequency to dump the phase space, i.e.dump data when step%psDumpFreq==0
extern int psDumpFreq;
// CKR: nowhere used
// /// Dump centroid when R >rDump
// extern double rDump;
/// The frequency to dump statistical values, e.e. dump data when step%statDumpFreq==0
extern int statDumpFreq;
/// The frequency to dump single particle trajectory of particles with ID = 0 & 1
extern int sptDumpFreq;
/// The frequency to do particles repartition for better load balance between nodes
extern int repartFreq;
/// The frequency to reset energy bin ID for all particles
extern int rebinFreq;
/// phase space dump flag for OPAL-cycl
// if true, dump phase space after each turn
extern bool psDumpEachTurn;
// Governs how often boundp_destroy is called to destroy lost particles
// Mainly used in the CyclotronTracker as of now -DW
extern int boundpDestroyFreq;
/// flag to decide in which coordinate frame the phase space will be dumped for OPAL-cycl
// if true, in local Cartesian frame, otherwise in global Cartesian frame
extern bool psDumpLocalFrame;
/// The frequency to solve space charge fields.
extern int scSolveFreq;
// How many small timesteps are inside the large timestep used in multiple time stepping (MTS) integrator
extern int mtsSubsteps;
/// this allows to repeat tracks starting always at the begining of the lattice and
/// generates a new distribution
extern bool scan;
extern bool rhoDump;
extern bool ebDump;
// CKR: nowhere used
// extern bool efDump;
// if true opal find the phases in the cavities, such that the energy gain is at maximum
extern int autoPhase;
/// The frequency to dump the particle-geometry surface interation data.
extern int surfDumpFreq;
/// RCG: cycle length
extern int numBlocks;
/// RCG: number of recycle blocks
extern int recycleBlocks;
/// number of old left hand sides used to extrapolate a new start vector
extern int nLHS;
extern std::string rngtype;
/// if true
extern bool schottkyCorrection;
///
extern double schottkyRennormalization;
/// Do closed orbit and tune calculation only.
extern bool cloTuneOnly;
}
#endif // OPAL_Options_HH
#include "Algorithms/AutophaseTracker.h"
#include "Utilities/ClassicField.h"
#include "AbstractObjects/OpalData.h"
#include "Utilities/OpalOptions.h"
#include "Utilities/Options.h"
#include "Utilities/Timer.h"
#include <iostream>
......
......@@ -73,7 +73,7 @@
#include "Structure/H5PartWrapperForPC.h"
#include "Structure/BoundaryGeometry.h"
#include "Utilities/OpalOptions.h"
#include "Utilities/Options.h"
#include "Ctunes.h"
#include <cassert>
......
......@@ -10,7 +10,7 @@
#include "Algorithms/Tracker.h"
#include "Structure/DataSink.h"
#include "Utilities/Options.h"
#include "Utilities/OpalOptions.h"
#include "Utilities/Options.h"
#include "Physics/Physics.h"
......
......@@ -59,7 +59,7 @@
#include "AbstractObjects/OpalData.h"
#include "BasicActions/Option.h"
#include "Utilities/OpalOptions.h"
#include "Utilities/Options.h"
#include "Utilities/Options.h"
#include "Distribution/Distribution.h"
......
......@@ -23,7 +23,7 @@
#include "Structure/DataSink.h"
#include "BasicActions/Option.h"
#include "Utilities/OpalOptions.h"
#include "Utilities/Options.h"
#include "Utilities/Options.h"
#include "Physics/Physics.h"
......
......@@ -20,7 +20,7 @@
#include "Attributes/Attributes.h"
#include "Parser/FileStream.h"
#include "Utilities/Options.h"
#include "Utilities/OpalOptions.h"
#include "Utilities/Options.h"
#include "Utilities/Random.h"
#include <ctime>
#include <iostream>
......@@ -157,7 +157,7 @@ Option::Option():
("NLHS", "Number of stored old solutions for extrapolating the new starting vector. Default value is 1 and just the last solution is used.");
itsAttr[ENABLEHDF5] = Attributes::makeBool
("ENABLEHDF5", "If true, HDF5 actions are enabled", true);
("ENABLEHDF5", "If true, HDF5 actions are enabled", enableHDF5);
itsAttr[ASCIIDUMP] = Attributes::makeBool
("ASCIIDUMP", "If true, some of the elements dump in ASCII instead of HDF5", false);
......
......@@ -23,7 +23,7 @@
#include <utility>
#include <vector>
#include "Utilities/OpalOptions.h"
#include "Utilities/Options.h"
#include "Utilities/Options.h"
#include "Utilities/OpalException.h"
......
......@@ -25,7 +25,7 @@
#include "AbstractObjects/Expressions.h"
#include "Attributes/Attributes.h"
#include "Utilities/OpalOptions.h"
#include "Utilities/Options.h"
#include "Utilities/Options.h"
#include "halton1d_sequence.hh"
#include "AbstractObjects/OpalData.h"
......
......@@ -30,7 +30,7 @@
#include <vector>
#include "Physics/Physics.h"
#include "Utilities/OpalOptions.h"
#include "Utilities/Options.h"
#include "Utilities/Options.h"
#include "Utilities/OpalException.h"
......
......@@ -36,7 +36,7 @@
#include "MemoryManagement/Pointer.h"
#include "Tables/Selector.h"
#include "Utilities/OpalException.h"
#include "Utilities/OpalOptions.h"
#include "Utilities/Options.h"
#include "Utilities/RegularExpression.h"
#include <iostream>
......
......@@ -19,7 +19,7 @@
#include "AbsBeamline/Septum.h"
#include "BasicActions/Option.h"
#include "Utilities/OpalOptions.h"
#include "Utilities/Options.h"
#include "Utilities/Options.h"
#include "Utilities/OpalSection.h"
#include "Utilities/ClassicField.h"
......
......@@ -26,7 +26,7 @@
#include "Errors/ErrorParser.h"
#include "Errors/MPHandler.h"
#include "Errors/MPRemover.h"
#include "Utilities/OpalOptions.h"
#include "Utilities/Options.h"
#include "Utilities/Round.h"
......
......@@ -22,7 +22,7 @@
#include "Errors/Error.h"
#include "Errors/MPHandler.h"
#include "Fields/BMultipoleField.h"
#include "Utilities/OpalOptions.h"
#include "Utilities/Options.h"
#include "Utilities/Options.h"
#include "Utilities/Round.h"
#include <cmath>
......
......@@ -22,7 +22,7 @@
#include "Errors/Error.h"
#include "Errors/MPHandler.h"
#include "Fields/BMultipoleField.h"
#include "Utilities/OpalOptions.h"
#include "Utilities/Options.h"
#include "Utilities/Options.h"
#include "Utilities/Round.h"
#include <cmath>
......
......@@ -25,7 +25,7 @@
#include "Expressions/SValue.h"
#include "Utilities/OpalException.h"
//#include "Utilities/Options.h"
#include "Utilities/OpalOptions.h"
#include "Utilities/Options.h"
#include <vector>
......
......@@ -23,7 +23,7 @@
#include "AbstractObjects/OpalData.h"
#include "Expressions/SValue.h"
#include "Utilities/OpalException.h"
#include "Utilities/OpalOptions.h"
#include "Utilities/Options.h"
#include <iosfwd>
#if defined(__GNUC__) && __GNUC__ < 3
#include <strstream>
......
......@@ -36,7 +36,7 @@ Inform *gmsg;
#include "FixedAlgebra/FTps.h"
#include "BasicActions/Option.h"
#include "Utilities/OpalOptions.h"
#include "Utilities/Options.h"
#include "Utilities/Options.h"
#include "Utilities/OpalException.h"
......
......@@ -21,7 +21,7 @@
#include "Match/ConcreteVar.h"
#include "Match/Match.h"
#include "Match/MatchLimits.h"
#include "Utilities/OpalOptions.h"
#include "Utilities/Options.h"
#include <iostream>
......
......@@ -33,7 +33,7 @@
#include "Parser/Token.h"
#include "Utilities/OpalException.h"
#include "Utilities/ParseError.h"
#include "Utilities/OpalOptions.h"
#include "Utilities/Options.h"
#include "Utilities/Round.h"
#include <cassert>
#include <ctime>
......
......@@ -19,7 +19,7 @@
#include "Attributes/Attributes.h"
#include "ValueDefinitions/RealVariable.h"
#include "AbstractObjects/OpalData.h"
#include "Utilities/OpalOptions.h"
#include "Utilities/Options.h"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
......
......@@ -8,7 +8,7 @@
#include "revision.h"
#include "Algorithms/bet/EnvelopeBunch.h"
#include "AbstractObjects/OpalData.h"
#include "Utilities/OpalOptions.h"
#include "Utilities/Options.h"
#include "Utilities/Options.h"
#include "Fields/Fieldmap.h"
#include "Structure/BoundaryGeometry.h"
......
......@@ -7,7 +7,7 @@
#include "config.h"
#include "Algorithms/PartBunch.h"
#include "AbstractObjects/OpalData.h"
#include "Utilities/OpalOptions.h"
#include "Utilities/Options.h"
#include "Utilities/Options.h"
#include "Physics/Physics.h"
......
......@@ -8,7 +8,7 @@
#include "revision.h"
#include "Algorithms/PartBunch.h"
#include "AbstractObjects/OpalData.h"
#include "Utilities/OpalOptions.h"
#include "Utilities/Options.h"
#include "Utilities/Options.h"
#include "Physics/Physics.h"
......
......@@ -9,7 +9,7 @@
#include "Algorithms/PartBunch.h"
#include "Algorithms/bet/EnvelopeBunch.h"
#include "AbstractObjects/OpalData.h"
#include "Utilities/OpalOptions.h"
#include "Utilities/Options.h"
#include "Utilities/Options.h"
#include "Physics/Physics.h"
......
......@@ -8,7 +8,7 @@
#include "revision.h"
#include "Algorithms/PartBunch.h"
#include "AbstractObjects/OpalData.h"
#include "Utilities/OpalOptions.h"
#include "Utilities/Options.h"
#include "Utilities/Options.h"
#include "Physics/Physics.h"
......
......@@ -30,7 +30,7 @@
#include "Structure/Beam.h"
#include "Tables/Flatten.h"
#include "Utilities/OpalException.h"
#include "Utilities/OpalOptions.h"
#include "Utilities/Options.h"
#include "Utilities/Round.h"
#include <iomanip>
#include <iostream>
......
......@@ -31,7 +31,7 @@
#include "Physics/Physics.h"
#include "Structure/Beam.h"
#include "Utilities/OpalException.h"
#include "Utilities/OpalOptions.h"
#include "Utilities/Options.h"
#include "Utilities/Round.h"
#include <cmath>
#include <iomanip>
......
......@@ -24,7 +24,7 @@
#include "AbstractObjects/Table.h"
#include "Beamlines/FlaggedElmPtr.h"
#include "Elements/OpalElement.h"
#include "Utilities/OpalOptions.h"
#include "Utilities/Options.h"
#include "Utilities/RegularExpression.h"
#include <iostream>
......
......@@ -30,7 +30,7 @@
#include "Physics/Physics.h"
#include "Tables/Flatten.h"
#include "Utilities/OpalException.h"
#include "Utilities/OpalOptions.h"
#include "Utilities/Options.h"
#include <cmath>
#include <iomanip>
......
......@@ -29,7 +29,7 @@
#include "Tables/Flatten.h"
#include "Utilities/DomainError.h"
#include "Utilities/OpalException.h"
#include "Utilities/OpalOptions.h"
#include "Utilities/Options.h"
#include "Utilities/Round.h"
#include <iomanip>
#include <iostream>
......
......@@ -29,7 +29,7 @@
#include "Tables/Flatten.h"
#include "Utilities/DomainError.h"
#include "Utilities/OpalException.h"
#include "Utilities/OpalOptions.h"
#include "Utilities/Options.h"
#include "Utilities/Round.h"
#include <iomanip>
#include <iostream>
......
......@@ -34,7 +34,7 @@
#include "Structure/Beam.h"
#include "Tables/Flatten.h"
#include "Utilities/OpalException.h"
#include "Utilities/OpalOptions.h"
#include "Utilities/Options.h"
#include "Utilities/Round.h"
#include <cmath>
......
......@@ -2,7 +2,6 @@ set (_SRCS
NumToStr.cpp
OpalException.cpp
OpalFilter.cpp
OpalOptions.cpp
OpalSection.cpp
RegularExpression.cpp
Round.cpp
......
......@@ -2,68 +2,5 @@
#include <string>
namespace Options {
// The global program options.
bool mtrace = false;
bool verify = false;
bool warn = true;
bool psDumpEachTurn = false;
bool psDumpLocalFrame = false;
bool scan = false;
bool rhoDump = false;
bool ebDump = false;
// bool efDump = false;
// The global random generator.
Random rangen;
// The current random seed.
int seed = 123456789;
// the number of refinements of the search range for the phase with maximum energy
// if eq 0 then no autophase
int autoPhase = 0;
// The frequency to dump the phase space, i.e.dump data when step%psDumpFreq==0
int psDumpFreq = 10;
// // The frequency to dump the phase space, i.e.dump data when step%psDumpFreq==0
// double rDump = 0.0;
// The frequency to dump statistical quantities such as beam RMS properties, i.e. dump
// when step%statDumpFreq == 0.
int statDumpFreq = 10;
// The frequency to dump single particle trajectory of particles with ID = 0 & 1
int sptDumpFreq = 1;
// The frequency to do particles repartition for better load balance between nodes
int repartFreq = 10;
// The frequency to reset energy bin ID for all particles
int rebinFreq = 100;
/// The frequency to solve space charge fields.
int scSolveFreq = 1;
// How many small timesteps are inside the large timestep used in multiple time stepping (MTS) integrator
int mtsSubsteps = 1;
// The frequency to dump the particle-geometry surface interation data, -1 stands for no dump.
int surfDumpFreq = -1;
// Options for the Belos solver
int numBlocks = 0;
int recycleBlocks = 0;
int nLHS = 1;
std::string rngtype = std::string("RANDOM");
bool schottkyCorrection = false;
double schottkyRennormalization = -1;
bool cloTuneOnly;
// Governs how often boundp_destroy is called to destroy lost particles
// Mainly used in the CyclotronTracker as of now -DW
int boundpDestroyFreq = 10;
}
......@@ -5,103 +5,8 @@
namespace Options {
// CKR: nowhere used
// // true if in bet mode
// extern bool bet;
/// Trace flag.
// If true, print CPU time before and after each command.
extern bool mtrace;
/// Verify flag.
// If true, print warning about undefined variables.
extern bool verify;
/// Warn flag.
// If true, print warning messages.
extern bool warn;
/// Random generator.
// The global random generator.
extern Random rangen;
/// The current random seed.
extern int seed;
/// The frequency to dump the phase space, i.e.dump data when step%psDumpFreq==0
extern int psDumpFreq;
// CKR: nowhere used
// /// Dump centroid when R >rDump
// extern double rDump;
/// The frequency to dump statistical values, e.e. dump data when step%statDumpFreq==0
extern int statDumpFreq;
/// The frequency to dump single particle trajectory of particles with ID = 0 & 1
extern int sptDumpFreq;
/// The frequency to do particles repartition for better load balance between nodes
extern int repartFreq;
/// The frequency to reset energy bin ID for all particles
extern int rebinFreq;
/// phase space dump flag for OPAL-cycl
// if true, dump phase space after each turn
extern bool psDumpEachTurn;
// Governs how often boundp_destroy is called to destroy lost particles
// Mainly used in the CyclotronTracker as of now -DW
extern int boundpDestroyFreq;
/// flag to decide in which coordinate frame the phase space will be dumped for OPAL-cycl
// if true, in local Cartesian frame, otherwise in global Cartesian frame
extern bool psDumpLocalFrame;
/// The frequency to solve space charge fields.
extern int scSolveFreq;
// How many small timesteps are inside the large timestep used in multiple time stepping (MTS) integrator
extern int mtsSubsteps;
/// this allows to repeat tracks starting always at the begining of the lattice and
/// generates a new distribution
extern bool scan;
extern bool rhoDump;
extern bool ebDump;
// CKR: nowhere used
// extern bool efDump;
// if true opal find the phases in the cavities, such that the energy gain is at maximum
extern int autoPhase;
/// The frequency to dump the particle-geometry surface interation data.
extern int surfDumpFreq;
/// RCG: cycle length
extern int numBlocks;
/// RCG: number of recycle blocks
extern int recycleBlocks;
/// number of old left hand sides used to extrapolate a new start vector
extern int nLHS;
extern std::string rngtype;
/// if true
extern bool schottkyCorrection;
///
extern double schottkyRennormalization;
/// Do closed orbit and tune calculation only.
extern bool cloTuneOnly;
}