OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
FM2DMagnetoStatic.h
Go to the documentation of this file.
1 #ifndef CLASSIC_FIELDMAP2DMAGNETOSTATIC_HH
2 #define CLASSIC_FIELDMAP2DMAGNETOSTATIC_HH
3 
4 #include "Fields/Fieldmap.h"
5 
6 class FM2DMagnetoStatic: public Fieldmap {
7 
8 public:
9  virtual bool getFieldstrength(const Vector_t &R, Vector_t &E, Vector_t &B) const;
10  virtual bool getFieldDerivative(const Vector_t &R, Vector_t &E, Vector_t &B, const DiffDirection &dir) const;
11  virtual void getFieldDimensions(double &zBegin, double &zEnd) const;
12  virtual void getFieldDimensions(double &xIni, double &xFinal, double &yIni, double &yFinal, double &zIni, double &zFinal) const;
13  virtual void swap();
14  virtual void getInfo(Inform *msg);
15  virtual double getFrequency() const;
16  virtual void setFrequency(double freq);
17 
18  virtual bool isInside(const Vector_t &r) const;
19 private:
20  FM2DMagnetoStatic(std::string aFilename);
22 
23  virtual void readMap();
24  virtual void freeMap();
25 
29  double rbegin_m;
30  double rend_m;
31  double zbegin_m;
32  double zend_m;
33  double hz_m;
34  double hr_m;
38  bool swap_m;
39  friend class Fieldmap;
40 };
41 
42 inline bool FM2DMagnetoStatic::isInside(const Vector_t &r) const
43 {
44  return r(2) >= zbegin_m && r(2) < zend_m && std::sqrt(r(0)*r(0) + r(1)*r(1)) < rend_m;
45 }
46 
47 #endif
Tps< T > sqrt(const Tps< T > &x)
Square root.
Definition: TpsMath.h:91
DiffDirection
Definition: Fieldmap.h:54
virtual void readMap()
virtual bool getFieldstrength(const Vector_t &R, Vector_t &E, Vector_t &B) const
virtual double getFrequency() const
virtual void getInfo(Inform *msg)
virtual bool isInside(const Vector_t &r) const
virtual void getFieldDimensions(double &zBegin, double &zEnd) const
virtual void setFrequency(double freq)
virtual bool getFieldDerivative(const Vector_t &R, Vector_t &E, Vector_t &B, const DiffDirection &dir) const
FM2DMagnetoStatic(std::string aFilename)
virtual void freeMap()
Definition: Inform.h:42