File indexing completed on 2025-08-06 08:17:58
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #ifndef PHFIELD_PHFIELD3DCYLINDRICAL_H
0021 #define PHFIELD_PHFIELD3DCYLINDRICAL_H
0022
0023 #include "PHField.h"
0024
0025 #include <map>
0026 #include <string>
0027 #include <tuple>
0028 #include <vector>
0029
0030 class PHField3DCylindrical : public PHField
0031 {
0032 typedef std::tuple<float, float, float> trio;
0033
0034 public:
0035 PHField3DCylindrical(const std::string& filename, int verb = 0, const float magfield_rescale = 1.0);
0036 ~PHField3DCylindrical() override {}
0037 void GetFieldValue(const double Point[4], double* Bfield) const override;
0038 void GetFieldCyl(const double CylPoint[4], double* Bfield) const;
0039
0040 protected:
0041
0042 std::vector<std::vector<std::vector<float> > > BFieldZ_;
0043 std::vector<std::vector<std::vector<float> > > BFieldR_;
0044 std::vector<std::vector<std::vector<float> > > BFieldPHI_;
0045
0046
0047 std::vector<float> z_map_;
0048 std::vector<float> r_map_;
0049 std::vector<float> phi_map_;
0050
0051 float maxz_, minz_;
0052
0053 private:
0054 bool bin_search(const std::vector<float>& vec, unsigned start, unsigned end, const float& key, unsigned& index) const;
0055 void print_map(std::map<trio, trio>::iterator& it) const;
0056 };
0057
0058 #endif