18 std::string tmpString;
25 bool parsing_passed =
true;
32 if (tmpString !=
"TRUE" &&
35 "The second string on the first line of 3D field "
36 "maps has to be either TRUE or FALSE");
41 parsing_passed = parsing_passed &&
43 parsing_passed = parsing_passed &&
45 parsing_passed = parsing_passed &&
49 parsing_passed = parsing_passed &&
56 parsing_passed = parsing_passed &&
63 "An error occured when reading the fieldmap '" +
Filename_m +
"'");
83 "An error occured when reading the fieldmap '" +
Filename_m +
"'");
101 std::string tmpString;
130 unsigned int centerX =
static_cast<unsigned int>(std::round(-
xbegin_m /
hx_m));
131 unsigned int centerY =
static_cast<unsigned int>(std::round(-
ybegin_m /
hy_m));
134 if(std::abs(By) > Bymax) {
135 Bymax = std::abs(By);
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)];
232 (*msg) <<
Filename_m <<
" (3D magnetostatic) "
std::shared_ptr< _FM3DMagnetoStatic > FM3DMagnetoStatic
Inform & endl(Inform &inf)
Inform & level3(Inform &inf)
std::string toUpper(const std::string &str)
bool interpreteEOF(std::ifstream &in)
static std::string typeset_msg(const std::string &msg, const std::string &title)
void getLine(std::ifstream &in, std::string &buffer)
bool interpretLine(std::ifstream &in, S &value, const bool &file_length_known=true)
unsigned int num_gridpx_m
double getWeightedData(double *data, const IndexTriplet &idx, unsigned short corner) const
virtual ~_FM3DMagnetoStatic()
IndexTriplet getIndex(const Vector_t &X) const
double * FieldstrengthBx_m
double * FieldstrengthBy_m
unsigned int num_gridpz_m
unsigned int num_gridpy_m
virtual void getInfo(Inform *msg)
static FM3DMagnetoStatic create(const std::string &filename)
_FM3DMagnetoStatic(const std::string &filename)
virtual bool getFieldstrength(const Vector_t &R, Vector_t &E, Vector_t &B) const
virtual bool isInside(const Vector_t &r) const
double * FieldstrengthBz_m
virtual void getFieldDimensions(double &zBegin, double &zEnd) const
virtual bool getFieldDerivative(const Vector_t &R, Vector_t &E, Vector_t &B, const DiffDirection &dir) const
Vector_t interpolateTrilinearly(const Vector_t &X) const
Vektor< double, 3 > Vector_t