OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
FM2DDynamic.h
Go to the documentation of this file.
1 #ifndef CLASSIC_FIELDMAP2DDYNAMIC_HH
2 #define CLASSIC_FIELDMAP2DDYNAMIC_HH
3 
4 #include "gsl/gsl_interp.h"
5 #include "gsl/gsl_spline.h"
6 #include "Fields/Fieldmap.h"
7 
8 class FM2DDynamic: public Fieldmap {
9 
10 public:
11  virtual bool getFieldstrength(const Vector_t &R, Vector_t &E, Vector_t &B) const;
12  virtual void getFieldDimensions(double &zBegin, double &zEnd) const;
13  virtual void getFieldDimensions(double &xIni, double &xFinal, double &yIni, double &yFinal, double &zIni, double &zFinal) const;
14  virtual bool getFieldDerivative(const Vector_t &R, Vector_t &E, Vector_t &B, const DiffDirection &dir) const;
15  virtual void swap();
16  virtual void getInfo(Inform *msg);
17  virtual double getFrequency() const;
18  virtual void setFrequency(double freq);
19  virtual void getOnaxisEz(std::vector<std::pair<double, double> > & F);
20 
21  virtual bool isInside(const Vector_t &r) const;
22 private:
23  FM2DDynamic(std::string aFilename);
24  ~FM2DDynamic();
25 
26  virtual void readMap();
27  virtual void freeMap();
28 
33  double frequency_m;
34 
35  double rbegin_m;
36  double rend_m;
37  double zbegin_m;
38  double zend_m;
39  double hz_m;
40  double hr_m;
44  bool swap_m;
45  friend class Fieldmap;
46 };
47 
48 inline bool FM2DDynamic::isInside(const Vector_t &r) const
49 {
50  return r(2) >= zbegin_m && r(2) < zend_m && std::sqrt(r(0)*r(0) + r(1)*r(1)) < rend_m;
51 }
52 
53 #endif
Tps< T > sqrt(const Tps< T > &x)
Square root.
Definition: TpsMath.h:91
DiffDirection
Definition: Fieldmap.h:54
double * FieldstrengthEz_m
Definition: FM2DDynamic.h:29
virtual void getFieldDimensions(double &zBegin, double &zEnd) const
virtual void swap()
double frequency_m
Definition: FM2DDynamic.h:33
double hr_m
Definition: FM2DDynamic.h:40
virtual double getFrequency() const
virtual void readMap()
virtual bool getFieldDerivative(const Vector_t &R, Vector_t &E, Vector_t &B, const DiffDirection &dir) const
virtual void setFrequency(double freq)
double rbegin_m
Definition: FM2DDynamic.h:35
double rend_m
Definition: FM2DDynamic.h:36
double hz_m
Definition: FM2DDynamic.h:39
double zbegin_m
Definition: FM2DDynamic.h:37
virtual void getInfo(Inform *msg)
virtual void getOnaxisEz(std::vector< std::pair< double, double > > &F)
double * FieldstrengthBt_m
Definition: FM2DDynamic.h:31
virtual void freeMap()
virtual bool isInside(const Vector_t &r) const
Definition: FM2DDynamic.h:48
FM2DDynamic(std::string aFilename)
Definition: FM2DDynamic.cpp:12
virtual bool getFieldstrength(const Vector_t &R, Vector_t &E, Vector_t &B) const
int num_gridpz_m
Definition: FM2DDynamic.h:42
int num_gridpr_m
Definition: FM2DDynamic.h:41
double zend_m
Definition: FM2DDynamic.h:38
double * FieldstrengthEr_m
Definition: FM2DDynamic.h:30
Definition: Inform.h:42