OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
Drift.h
Go to the documentation of this file.
1#ifndef CLASSIC_Drift_HH
2#define CLASSIC_Drift_HH
3
4// ------------------------------------------------------------------------
5// $RCSfile: Drift.h,v $
6// ------------------------------------------------------------------------
7// $Revision: 1.1.1.1 $
8// ------------------------------------------------------------------------
9// Copyright: see Copyright.readme
10// ------------------------------------------------------------------------
11//
12// Class: Drift
13// Defines the abstract interface for a drift space.
14//
15// ------------------------------------------------------------------------
16// Class category: AbsBeamline
17// ------------------------------------------------------------------------
18//
19// $Date: 2000/03/27 09:32:31 $
20// $Author: fci $
21//
22// ------------------------------------------------------------------------
23
25
26
27
28// Class Drift
29// ------------------------------------------------------------------------
31// Class Drift defines the abstract interface for a drift space.
32
33class Drift: public Component {
34
35public:
36
38 explicit Drift(const std::string &name);
39
40 Drift();
41 Drift(const Drift &right);
42 virtual ~Drift();
43
45 virtual void accept(BeamlineVisitor &) const override;
46
47 virtual void initialise(PartBunchBase<double, 3> *bunch, double &startField, double &endField) override;
48
49 virtual void finalise() override;
50
51 virtual bool bends() const override;
52
53 virtual ElementType getType() const override;
54
55 virtual void getDimensions(double &zBegin, double &zEnd) const override;
56
57 //set number of slices for map tracking
58 void setNSlices(const std::size_t& nSlices); // Philippe was here
59
60 //set number of slices for map tracking
61 std::size_t getNSlices() const; // Philippe was here
62
63 virtual int getRequiredNumberOfTimeSteps() const override;
64private:
65
67 std::size_t nSlices_m;
68
69 // Not implemented.
70 void operator=(const Drift &);
71};
72
73inline
75{
76 return 1;
77}
78
79#endif // CLASSIC_Drift_HH
ElementType
Definition: ElementBase.h:88
const std::string name
Interface for a single beam element.
Definition: Component.h:50
Interface for drift space.
Definition: Drift.h:33
void operator=(const Drift &)
virtual bool bends() const override
Definition: Drift.cpp:75
virtual ~Drift()
Definition: Drift.cpp:47
virtual void finalise() override
Definition: Drift.cpp:72
Drift()
Definition: Drift.cpp:30
virtual void getDimensions(double &zBegin, double &zEnd) const override
Definition: Drift.cpp:79
virtual int getRequiredNumberOfTimeSteps() const override
Definition: Drift.h:74
std::size_t nSlices_m
Definition: Drift.h:67
void setNSlices(const std::size_t &nSlices)
Definition: Drift.cpp:63
virtual void initialise(PartBunchBase< double, 3 > *bunch, double &startField, double &endField) override
Definition: Drift.cpp:55
virtual ElementType getType() const override
Get element type std::string.
Definition: Drift.cpp:84
virtual void accept(BeamlineVisitor &) const override
Apply visitor to Drift.
Definition: Drift.cpp:51
double startField_m
Definition: Drift.h:66
std::size_t getNSlices() const
Definition: Drift.cpp:68