OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
Track.h
Go to the documentation of this file.
1 //
2 // Class Track
3 // Hold data for tracking.
4 // Acts as a communication area between the various tracking commands.
5 //
6 // Copyright (c) 2008 - 2020, Paul Scherrer Institut, Villigen PSI, Switzerland
7 // All rights reserved
8 //
9 // This file is part of OPAL.
10 //
11 // OPAL is free software: you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation, either version 3 of the License, or
14 // (at your option) any later version.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with OPAL. If not, see <https://www.gnu.org/licenses/>.
18 //
19 
20 #ifndef OPAL_Track_HH
21 #define OPAL_Track_HH
22 
23 #include "Algorithms/PartData.h"
24 #include "Track/TrackParser.h"
25 #include <stack>
26 #include <vector>
27 
28 class BeamSequence;
29 
30 template <class T, unsigned Dim>
31 class PartBunchBase;
32 
33 class Track {
34 
35 public:
36 
37  Track(BeamSequence *, const PartData &, const std::vector<double> & dt,
38  const std::vector<unsigned long long> & maxtsteps, int stepsperturn,
39  double zStart, const std::vector<double> & zStop, int timeintegrator,
40  double t0, double dtScInit, double deltaTau);
41  ~Track();
42 
45 
48 
51 
54 
56  static Track *block;
57 
58  static void stash();
59  static Track* pop();
60 
62  std::vector<double> dT;
63 
64  // For AMTS integrator in OPAL-T
65  double dtScInit, deltaTau;
66 
69  double t0_m;
70 
72  std::vector<unsigned long long> localTimeSteps;
73 
76 
78  double zstart;
79 
81  std::vector<double> zstop;
82 
84  // 0 --- RK-4(default)
85  // 1 --- LF-2
86  // 2 --- MTS
87  // 3 --- AMTS
89 
92 
93 private:
94 
95  // Not implemented.
96  Track();
97  Track(const Track &);
98  void operator=(const Track &);
99 
100  static std::stack<Track*> stashedTrack;
101 };
102 
103 #endif // OPAL_Track_HH
The base class for all OPAL beam lines and sequences.
Definition: BeamSequence.h:32
Particle reference data.
Definition: PartData.h:35
Definition: Track.h:33
BeamSequence * use
The lattice to be tracked through.
Definition: Track.h:50
int stepsPerTurn
The timsteps per revolution period. ONLY available for OPAL-cycl.
Definition: Track.h:75
PartBunchBase< double, 3 > * bunch
The particle bunch to be tracked.
Definition: Track.h:44
PartData reference
The reference data.
Definition: Track.h:47
void operator=(const Track &)
double zstart
The location at which the simulation starts.
Definition: Track.h:78
~Track()
Definition: Track.cpp:72
std::vector< unsigned long long > localTimeSteps
Maximal number of timesteps.
Definition: Track.h:72
double deltaTau
Definition: Track.h:65
int timeIntegrator
The ID of time integrator.
Definition: Track.h:88
std::vector< double > zstop
The location at which the simulation stops.
Definition: Track.h:81
static Track * pop()
Definition: Track.cpp:82
static Track * block
The block of track data.
Definition: Track.h:56
TrackParser parser
The parser used during tracking.
Definition: Track.h:53
double t0_m
Definition: Track.h:69
double dtScInit
Definition: Track.h:65
int truncOrder
Trunction order for map tracking.
Definition: Track.h:91
static void stash()
Definition: Track.cpp:75
Track(const Track &)
std::vector< double > dT
The initial timestep.
Definition: Track.h:62
static std::stack< Track * > stashedTrack
Definition: Track.h:100