12 FieldstrengthEz_m(NULL),
13 FieldstrengthEr_m(NULL) {
15 std::string tmpString;
23 bool parsing_passed =
true;
25 parsing_passed = interpretLine<std::string, std::string>(file, tmpString, tmpString);
27 parsing_passed = interpretLine<std::string, std::string, std::string>(file,
33 if (tmpString !=
"TRUE" &&
36 "The third string on the first line of 2D field "
37 "maps has to be either TRUE or FALSE");
42 if (tmpString ==
"ZX") {
44 parsing_passed = parsing_passed &&
46 parsing_passed = parsing_passed &&
48 }
else if (tmpString ==
"XZ") {
50 parsing_passed = parsing_passed &&
52 parsing_passed = parsing_passed &&
55 std::cerr <<
"unknown orientation of 2D electrostatic fieldmap" <<
std::endl;
56 parsing_passed =
false;
60 parsing_passed = parsing_passed && interpretLine<double, double>(file, tmpDouble, tmpDouble);
63 parsing_passed = parsing_passed &&
69 if (!parsing_passed) {
73 "An error occured when reading the fieldmap '" +
Filename_m +
"'");
103 std::string tmpString;
119 interpretLine<double, double>(in,
128 interpretLine<double, double>(in,
172 const double leverr = (RR /
hr_m) - indexr;
184 const double EfieldR = (1.0 - leverz) * (1.0 - leverr) *
FieldstrengthEr_m[index1]
189 const double EfieldZ = (1.0 - leverz) * (1.0 - leverr) *
FieldstrengthEz_m[index1]
195 E(0) += EfieldR *
R(0) / RR;
196 E(1) += EfieldR *
R(1) / RR;
Tps< T > sqrt(const Tps< T > &x)
Square root.
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(const PETE_Expr< T > &l)
PETE_TUTree< FnFloor, typename T::PETE_Expr_t > floor(const PETE_Expr< T > &l)
Inform & endl(Inform &inf)
constexpr double e
The value of.
std::string toUpper(const std::string &str)
bool interpreteEOF(std::ifstream &in)
void disableFieldmapWarning()
static std::string typeset_msg(const std::string &msg, const std::string &title)
void getLine(std::ifstream &in, std::string &buffer)
double * FieldstrengthEr_m
virtual double getFrequency() const
virtual bool getFieldstrength(const Vector_t &R, Vector_t &E, Vector_t &B) const
FM2DElectroStatic(std::string aFilename)
double * FieldstrengthEz_m
virtual void setFrequency(double freq)
virtual void getFieldDimensions(double &zBegin, double &zEnd) const
virtual void getInfo(Inform *msg)
virtual bool getFieldDerivative(const Vector_t &R, Vector_t &E, Vector_t &B, const DiffDirection &dir) const