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");
83 (
"MAP_ORDER",
"Truncation order of maps for ThickTracker (default: 1, i.e. linear)", 1);
107 if (dt.size() == 0) {
132 if (zstop.size() == 0) {
133 zstop.push_back(1000000.0);
140 std::vector<unsigned long long> maxsteps_i;
141 if (maxsteps_d.size() == 0) {
142 maxsteps_i.push_back(10ul);
144 for (
auto it = maxsteps_d.begin(); it != maxsteps_d.end(); ++ it) {
146 maxsteps_i.push_back(10);
148 unsigned long long value = *it;
149 maxsteps_i.push_back(value);
164 if(name == std::string(
"RK-4"))
166 else if(name == std::string(
"LF-2"))
168 else if(name == std::string(
"MTS"))
170 else if(name == std::string(
"AMTS"))
183 std::vector<double> dt =
getDT();
185 std::vector<unsigned long long> maxsteps =
getMAXSTEPS();
188 std::vector<double> zstop =
getZSTOP();
192 size_t numTracks = dt.size();
193 numTracks =
std::max(numTracks, maxsteps.size());
194 numTracks =
std::max(numTracks, zstop.size());
195 for (
size_t i = dt.size(); i < numTracks; ++ i) {
196 dt.push_back(dt.back());
198 for (
size_t i = maxsteps.size(); i < numTracks; ++ i) {
199 maxsteps.push_back(maxsteps.back());
201 for (
size_t i = zstop.size(); i < numTracks; ++ i) {
202 zstop.push_back(zstop.back());
207 stepsperturn, zstart, zstop,
constexpr double e
The value of .
The base class for all OPAL actions.
size_t getNumberOfSlices()
Return the number of slices.
std::vector< double > getZSTOP() const
location at which the simulation stops
T::PETE_Expr_t::PETE_Return_t max(const PETE_Expr< T > &expr, NDIndex< D > &loc)
TrackCmd()
Exemplar constructor.
int getTIMEINTEGRATOR() const
return the name of time integrator
std::vector< Attribute > itsAttr
The object attributes (see Attribute.hh).
static void addAttributeOwner(const std::string &owner, const OwnerType &type, const std::string &name)
double getDTSCINIT() const
static BeamSequence * find(const std::string &name)
Find a BeamSequence by name.
TrackParser parser
The parser used during tracking.
static Beam * find(const std::string &name)
Find named BEAM.
void registerOwnership(const AttributeHandler::OwnerType &itsClass) const
static Track * block
The block of track data.
std::vector< double > getRealArray(const Attribute &attr)
Get array value.
std::vector< double > getDT() const
Return the timestep in seconds.
virtual void execute()
Execute the command.
int getSTEPSPERTURN() const
int truncOrder
Trunction order for map tracking.
virtual void run() const
Read current stream.
The base class for all OPAL beam lines and sequences.
double getT0() const
Return the elapsed time (sec) of the bunch.
const PartData & getReference() const
Return the embedded CLASSIC PartData.
Attribute makeRealArray(const std::string &name, const std::string &help)
Create real array attribute.
double getZSTART() const
location at which the simulation starts
double getReal(const Attribute &attr)
Return real value.
Attribute makeString(const std::string &name, const std::string &help)
Make string attribute.
Attribute makeReal(const std::string &name, const std::string &help)
Make real attribute.
std::vector< unsigned long long > getMAXSTEPS() const
Return the maximum timsteps we integrate the system.
virtual TrackCmd * clone(const std::string &name)
Make clone.
std::string getString(const Attribute &attr)
Get string value.