58 "The \"TRACK\" command initiates tracking.") {
60 (
"LINE",
"Name of lattice to be tracked");
62 (
"BEAM",
"Name of beam to be used",
"UNNAMED_BEAM");
64 (
"DT",
"THE INTEGRATION TIMESTEP IN SECONDS");
66 (
"DTSCINIT",
"Only for adaptive integrator: Initial time step for space charge integration", 1
e-12);
68 (
"DTAU",
"Only for adaptive integrator: Alternative way to set accuracy of space integration.", -1.0);
70 (
"T0",
"THE ELAPSED TIME OF THE BUNCH IN SECONDS", 0.0);
72 (
"MAXSTEPS",
"THE MAXIMUM NUMBER OF INTEGRATION STEPS DT, should be larger ZSTOP/(beta*c average)");
74 (
"STEPSPERTURN",
"THE TIME STEPS PER REVOLUTION PERIOD, ONLY FOR OPAL-CYCL", 720);
76 (
"ZSTART",
"Defines a z-location [m] where the reference particle starts", 0.0);
78 (
"ZSTOP",
"Defines a z-location [m], after which the simulation stops when the last particles passes");
80 (
"TIMEINTEGRATOR",
"Name of time integrator to be used", {
"RK-4",
"RK_4",
"LF-2",
"LF_2",
"MTS"},
"RK_4");
83 (
"MAP_ORDER",
"Truncation order of maps for ThickTracker (default: 1, i.e. linear)", 1);
105 if (dTs.size() == 0) {
106 dTs.push_back(1
e-12);
108 for (
double dt : dTs) {
111 "The time steps provided with DT have to be positive");
136 if (zstop.size() == 0) {
137 zstop.push_back(1000000.0);
144 std::vector<unsigned long long> maxsteps_i;
145 if (maxsteps_d.size() == 0) {
146 maxsteps_i.push_back(10ul);
148 for (
double numSteps : maxsteps_d) {
151 "The number of steps provided with MAXSTEPS has to be positive");
153 unsigned long long value = numSteps;
154 maxsteps_i.push_back(value);
169 if(
name == std::string(
"RK-4") ||
name == std::string(
"RK_4"))
171 else if(
name == std::string(
"LF-2") ||
name == std::string(
"LF_2"))
173 else if(
name == std::string(
"MTS"))
175 else if(
name == std::string(
"AMTS"))
188 std::vector<double> dt =
getDT();
190 std::vector<unsigned long long> maxsteps =
getMAXSTEPS();
193 std::vector<double> zstop =
getZSTOP();
196 size_t numTracks = dt.size();
197 numTracks =
std::max(numTracks, maxsteps.size());
198 numTracks =
std::max(numTracks, zstop.size());
199 for (
size_t i = dt.size(); i < numTracks; ++ i) {
200 dt.push_back(dt.back());
202 for (
size_t i = maxsteps.size(); i < numTracks; ++ i) {
203 maxsteps.push_back(maxsteps.back());
205 for (
size_t i = zstop.size(); i < numTracks; ++ i) {
206 zstop.push_back(zstop.back());
211 stepsperturn, zstart, zstop,
T::PETE_Expr_t::PETE_Return_t max(const PETE_Expr< T > &expr, NDIndex< D > &loc)
double getReal(const Attribute &attr)
Return real 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.
Attribute makeRealArray(const std::string &name, const std::string &help)
Create real array attribute.
std::vector< double > getRealArray(const Attribute &attr)
Get array value.
std::string getString(const Attribute &attr)
Get string value.
Attribute makeString(const std::string &name, const std::string &help)
Make string attribute.
constexpr double e
The value of.
The base class for all OPAL actions.
static void addAttributeOwner(const std::string &owner, const OwnerType &type, const std::string &name)
The base class for all OPAL beam lines and sequences.
static BeamSequence * find(const std::string &name)
Find a BeamSequence by name.
void registerOwnership(const AttributeHandler::OwnerType &itsClass) const
std::vector< Attribute > itsAttr
The object attributes.
virtual void run() const
Read current stream.
static Beam * find(const std::string &name)
Find named BEAM.
const PartData & getReference() const
Return the embedded CLASSIC PartData.
static Track * block
The block of track data.
TrackParser parser
The parser used during tracking.
int truncOrder
Trunction order for map tracking.
double getDTSCINIT() const
virtual TrackCmd * clone(const std::string &name)
Make clone.
std::vector< double > getDT() const
Return the timestep in seconds.
std::vector< double > getZSTOP() const
location at which the simulation stops
virtual void execute()
Execute the command.
TrackCmd()
Exemplar constructor.
double getT0() const
Return the elapsed time (sec) of the bunch.
int getSTEPSPERTURN() const
std::vector< unsigned long long > getMAXSTEPS() const
Return the maximum timsteps we integrate the system.
int getTIMEINTEGRATOR() const
return the name of time integrator
double getZSTART() const
location at which the simulation starts
The base class for all OPAL exceptions.