OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
FM1DProfile1.h
Go to the documentation of this file.
1 #ifndef CLASSIC_FIELDMAP1DPROFILE1_HH
2 #define CLASSIC_FIELDMAP1DPROFILE1_HH
3 
4 #include "Fields/Fieldmap.h"
5 
6 /*
7  * Class FM1DProfile.
8  * --------------------------------------------------------------------------
9  * Field definition for 1D representation of bending magnet.
10  *
11  * Class FM1DProfile1 defines a 1D field map for us in bending magnets.
12  */
13 
14 class FM1DProfile1: public Fieldmap {
15 
16 public:
17 
18  virtual bool getFieldDerivative(const Vector_t &X,
19  Vector_t &E,
20  Vector_t &B,
21  const DiffDirection &dir) const;
22  virtual void get1DProfile1EntranceParam(double &entranceParameter1,
23  double &entranceParameter2,
24  double &entranceParameter3);
25  virtual void get1DProfile1ExitParam(double &exitParameter1,
26  double &exitParameter2,
27  double &exitParameter3);
28  virtual double getFieldGap();
29  virtual void getFieldDimensions(double &zBegin,
30  double &zEnd) const;
31  virtual void getFieldDimensions(double &xIni,
32  double &xFinal,
33  double &yIni,
34  double &yFinal,
35  double &zIni,
36  double &zFinal) const;
37  virtual bool getFieldstrength(const Vector_t &X,
38  Vector_t &strength,
39  Vector_t &info) const;
40  virtual double getFrequency() const;
41  virtual void getInfo(Inform *);
42  virtual void setFrequency(double freq);
43  virtual void get1DProfile1EngeCoeffs(std::vector<double> &engeCoeffsEntry,
44  std::vector<double> &engeCoeffsExit);
45  virtual void swap();
46 
47  virtual void setFieldGap(double gap);
48 
49 private:
50 
52  FM1DProfile1(std::string Filename);
53 
54  virtual ~FM1DProfile1();
55 
56  virtual void freeMap();
57  virtual void readMap();
58 
59  double computeEntranceFringe(double z) const;
60  double computeExitFringe(double z) const;
61  double computeFringe(const std::vector<double> &coefs, double z) const;
62  /*
63  * Entrance and exit position parameters. These are read in from the input
64  * input file. Ultimately they are used to determine the origin of the
65  * field Enge function and the extent of the field map. However, how they
66  * are used to do this depends on how the bend using the map is setup in the
67  * OPAL input file. So, we use generic terms to start.
68  */
75 
77  std::vector<double> engeCoeffsEntry_m;
78  std::vector<double> engeCoeffsExit_m;
79 
82  double gapHeight_m;
83 
84  double sBegin_m;
85  double sEnd_m;
86 
87  friend class Fieldmap;
88 };
89 
90 #endif
DiffDirection
Definition: Fieldmap.h:54
#define X(arg)
Definition: fftpack.cpp:112
bool info
Info flag.
Definition: Options.cpp:28
double entranceParameter2_m
Definition: FM1DProfile1.h:70
double entranceParameter3_m
Definition: FM1DProfile1.h:71
virtual void setFrequency(double freq)
double entranceParameter1_m
Definition: FM1DProfile1.h:69
double gapHeight_m
Enge function order for entry region.
Definition: FM1DProfile1.h:82
virtual void get1DProfile1ExitParam(double &exitParameter1, double &exitParameter2, double &exitParameter3)
double computeExitFringe(double z) const
virtual void freeMap()
double computeFringe(const std::vector< double > &coefs, double z) const
virtual ~FM1DProfile1()
double exitParameter2_m
Definition: FM1DProfile1.h:73
double exitParameter1_m
Definition: FM1DProfile1.h:72
virtual void get1DProfile1EngeCoeffs(std::vector< double > &engeCoeffsEntry, std::vector< double > &engeCoeffsExit)
virtual bool getFieldstrength(const Vector_t &X, Vector_t &strength, Vector_t &info) const
virtual double getFrequency() const
virtual bool getFieldDerivative(const Vector_t &X, Vector_t &E, Vector_t &B, const DiffDirection &dir) const
int polyOrderEntry_m
Definition: FM1DProfile1.h:80
virtual double getFieldGap()
virtual void setFieldGap(double gap)
virtual void swap()
double exitParameter3_m
Definition: FM1DProfile1.h:74
virtual void readMap()
virtual void getInfo(Inform *)
double sEnd_m
Start of field map in s coordinates (m).
Definition: FM1DProfile1.h:85
FM1DProfile1(std::string Filename)
Constructor with field map file name.
Definition: FM1DProfile1.cpp:9
double sBegin_m
Full gap height of field map.
Definition: FM1DProfile1.h:84
std::vector< double > engeCoeffsEntry_m
Enge coefficients for map entry and exit regions.
Definition: FM1DProfile1.h:77
virtual void getFieldDimensions(double &zBegin, double &zEnd) const
int polyOrderExit_m
Enge function order for entry region.
Definition: FM1DProfile1.h:81
virtual void get1DProfile1EntranceParam(double &entranceParameter1, double &entranceParameter2, double &entranceParameter3)
double computeEntranceFringe(double z) const
std::vector< double > engeCoeffsExit_m
Definition: FM1DProfile1.h:78
Definition: Inform.h:42