12 FieldstrengthBz_m(NULL),
13 FieldstrengthBr_m(NULL) {
15 std::string tmpString;
23 bool parsing_passed =
true;
25 parsing_passed = interpretLine<std::string, std::string>(file,
29 parsing_passed = interpretLine<std::string, std::string, std::string>(file,
35 if (tmpString !=
"TRUE" &&
38 "The third string on the first line of 2D field "
39 "maps has to be either TRUE or FALSE");
44 if(tmpString ==
"ZX") {
46 parsing_passed = parsing_passed &&
48 parsing_passed = parsing_passed &&
50 }
else if(tmpString ==
"XZ") {
52 parsing_passed = parsing_passed &&
54 parsing_passed = parsing_passed &&
57 std::cerr <<
"unknown orientation of 2D magnetostatic fieldmap" <<
std::endl;
58 parsing_passed =
false;
62 parsing_passed = parsing_passed && interpretLine<double, double>(file, tmpDouble, tmpDouble);
65 parsing_passed = parsing_passed &&
75 "An error occured when reading the fieldmap '" +
Filename_m +
"'");
105 std::string tmpString;
119 interpretLine<double, double>(in,
127 interpretLine<double, double>(in,
172 const double leverr = (RR /
hr_m) - indexr;
185 const double BfieldR = (1.0 - leverz) * (1.0 - leverr) *
FieldstrengthBr_m[index1]
190 const double BfieldZ = (1.0 - leverz) * (1.0 - leverr) *
FieldstrengthBz_m[index1]
196 B(0) += BfieldR *
R(0) / RR;
197 B(1) += BfieldR *
R(1) / RR;
205 double BfieldR, BfieldZ;
210 const double leverr = (RR /
hr_m) - indexr;
213 const double leverz = (
R(2) /
hz_m) - indexz;
298 B(0) += BfieldR *
R(0) / RR;
299 B(1) += BfieldR *
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)
Inform & level3(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)
virtual bool getFieldstrength(const Vector_t &R, Vector_t &E, Vector_t &B) const
virtual double getFrequency() const
virtual void getInfo(Inform *msg)
virtual void getFieldDimensions(double &zBegin, double &zEnd) const
double * FieldstrengthBr_m
double * FieldstrengthBz_m
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)