13 FieldstrengthEz_m(NULL),
14 FieldstrengthEr_m(NULL) {
16 std::string tmpString;
24 bool parsing_passed =
true;
26 parsing_passed = interpreteLine<std::string, std::string>(file, tmpString, tmpString);
28 parsing_passed = interpreteLine<std::string, std::string, std::string>(file,
34 if (tmpString !=
"TRUE" &&
37 "The third string on the first line of 2D field "
38 "maps has to be either TRUE or FALSE");
43 if (tmpString ==
"ZX") {
45 parsing_passed = parsing_passed &&
47 parsing_passed = parsing_passed &&
49 }
else if (tmpString ==
"XZ") {
51 parsing_passed = parsing_passed &&
53 parsing_passed = parsing_passed &&
56 cerr <<
"unknown orientation of 2D electrostatic fieldmap" <<
endl;
57 parsing_passed =
false;
61 parsing_passed = parsing_passed && interpreteLine<double, double>(file, tmpDouble, tmpDouble);
64 parsing_passed = parsing_passed &&
70 if (!parsing_passed) {
74 "An error occured when reading the fieldmap '" +
Filename_m +
"'");
104 std::string tmpString;
120 interpreteLine<double, double>(in,
129 interpreteLine<double, double>(in,
170 const double RR =
sqrt(
R(0) *
R(0) +
R(1) *
R(1));
172 const int indexr = (int)
floor(RR /
hr_m);
173 const double leverr = (RR /
hr_m) - indexr;
176 const double leverz = (
R(2) /
hz_m) - indexz;
185 const double EfieldR = (1.0 - leverz) * (1.0 - leverr) *
FieldstrengthEr_m[index1]
190 const double EfieldZ = (1.0 - leverz) * (1.0 - leverr) *
FieldstrengthEz_m[index1]
196 E(0) += EfieldR *
R(0) / RR;
197 E(1) += EfieldR *
R(1) / RR;
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(const PETE_Expr< T > &l)
constexpr double e
The value of .
virtual void getInfo(Inform *msg)
PETE_TUTree< FnFabs, typename T::PETE_Expr_t > fabs(const PETE_Expr< T > &l)
std::string toUpper(const std::string &str)
void disableFieldmapWarning()
virtual double getFrequency() const
static std::string typeset_msg(const std::string &msg, const std::string &title)
FM2DElectroStatic(std::string aFilename)
virtual void getFieldDimensions(double &zBegin, double &zEnd, double &rBegin, double &rEnd) const
double * FieldstrengthEz_m
bool interpreteEOF(std::ifstream &in)
virtual bool getFieldstrength(const Vector_t &R, Vector_t &E, Vector_t &B) const
Tps< T > sqrt(const Tps< T > &x)
Square root.
double * FieldstrengthEr_m
void getLine(std::ifstream &in, std::string &buffer)
virtual void setFrequency(double freq)
virtual bool getFieldDerivative(const Vector_t &R, Vector_t &E, Vector_t &B, const DiffDirection &dir) const
PETE_TUTree< FnFloor, typename T::PETE_Expr_t > floor(const PETE_Expr< T > &l)
Inform & endl(Inform &inf)