17 FieldstrengthBz_m(NULL),
18 FieldstrengthBx_m(NULL),
19 FieldstrengthBy_m(NULL) {
21 std::string tmpString;
28 bool parsing_passed =
true;
30 interpreteLine<std::string>(file, tmpString);
32 parsing_passed = interpreteLine<std::string, std::string>(file, tmpString, tmpString);
35 if (tmpString !=
"TRUE" &&
38 "The second string on the first line of 3D field "
39 "maps has to be either TRUE or FALSE");
43 parsing_passed = parsing_passed &&
45 parsing_passed = parsing_passed &&
47 parsing_passed = parsing_passed &&
51 parsing_passed = parsing_passed &&
52 interpreteLine<double>(file,
58 parsing_passed = parsing_passed &&
65 zend_m = zbegin_m - 1e-3;
67 "An error occured when reading the fieldmap '" +
Filename_m +
"'");
101 std::string tmpString;
117 interpreteLine<double>(in,
140 for(
size_t i = 0; i < totalSize; ++ i) {
209 unsigned short switchX = ((corner &
HX) >> 2), switchY = ((corner &
HY) >> 1), switchZ = (corner &
HZ);
210 double factorX = 0.5 + (1 - 2 * switchX) * (0.5 - idx.
weight(0));
211 double factorY = 0.5 + (1 - 2 * switchY) * (0.5 - idx.
weight(1));
212 double factorZ = 0.5 + (1 - 2 * switchZ) * (0.5 - idx.
weight(2));
214 unsigned long i = idx.
i + switchX, j = idx.
j + switchY, k = idx.
k + switchZ;
216 return factorX * factorY * factorZ * data[
getIndex(i, j, k)];
234 (*msg) <<
Filename_m <<
" (3D magnetostatic) "
Vector_t interpolateTrilinearly(const Vector_t &X) const
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(const PETE_Expr< T > &l)
constexpr double e
The value of .
double * FieldstrengthBz_m
std::string toUpper(const std::string &str)
void disableFieldmapWarning()
virtual void getFieldDimensions(double &zBegin, double &zEnd, double &rBegin, double &rEnd) const
unsigned int num_gridpy_m
static std::string typeset_msg(const std::string &msg, const std::string &title)
virtual bool getFieldstrength(const Vector_t &R, Vector_t &E, Vector_t &B) const
double * FieldstrengthBy_m
constexpr double mu_0
The permeability of vacuum in Vs/Am.
bool interpreteEOF(std::ifstream &in)
IndexTriplet getIndex(const Vector_t &X) const
unsigned int num_gridpx_m
virtual void getInfo(Inform *msg)
double getWeightedData(double *data, const IndexTriplet &idx, unsigned short corner) const
void getLine(std::ifstream &in, std::string &buffer)
FM3DMagnetoStatic(std::string aFilename)
virtual bool isInside(const Vector_t &r) const
virtual bool getFieldDerivative(const Vector_t &R, Vector_t &E, Vector_t &B, const DiffDirection &dir) const
Inform & level3(Inform &inf)
double * FieldstrengthBx_m
PETE_TUTree< FnFloor, typename T::PETE_Expr_t > floor(const PETE_Expr< T > &l)
Inform & endl(Inform &inf)
unsigned int num_gridpz_m