29 if(!parsing_passed && !file.eof()) {
33 "An error occured when reading the fieldmap '" +
Filename_m +
"'");
77 const double RR2 =
R(0) *
R(0) +
R(1) *
R(1);
85 const double EfieldR = -ezp / 2. + ezppp / 16. * RR2;
87 E(0) += EfieldR *
R(0);
88 E(1) += EfieldR *
R(1);
89 E(2) += ez - ezpp * RR2 / 4.;
118 std::string tmpString;
123 passed = interpretLine<std::string, int>(file, tmpString, tmpInt);
125 passed = interpretLine<std::string, int, std::string>(file, tmpString, tmpInt, tmpString);
128 if (tmpString !=
"TRUE" &&
129 tmpString !=
"FALSE")
131 "The third string on the first line of 1D field "
132 "maps has to be either TRUE or FALSE");
141 std::string tmpString;
145 interpretLine<std::string, int>(file, tmpString, accuracy);
147 interpretLine<std::string, int, std::string>(file, tmpString, accuracy, tmpString);
Inform & endl(Inform &inf)
Inform & level3(Inform &inf)
constexpr double e
The value of.
std::string toUpper(const std::string &str)
bool determineNumSamplingPoints(std::ifstream &file)
double readFieldData(std::ifstream &file)
void computeFieldDerivatives(std::vector< double > &fourierComponents, int accuracy)
gsl_spline * onAxisInterpolants_m[4]
std::vector< double > getEvenlyDistributedSamplingPoints()
void normalizeFieldData(double maxEz)
std::vector< double > computeFourierCoefficients(int accuracy, std::vector< double > &evenSampling)
gsl_interp_accel * onAxisAccel_m[4]
std::vector< double > interpolateFieldData(std::vector< double > &samplingPoints)
virtual bool getFieldstrength(const Vector_t &R, Vector_t &E, Vector_t &B) const
Astra1DElectroStatic_fast(std::string aFilename)
bool readFileHeader(std::ifstream &file)
~Astra1DElectroStatic_fast()
virtual void getInfo(Inform *)
virtual bool getFieldDerivative(const Vector_t &R, Vector_t &E, Vector_t &B, const DiffDirection &dir) const
virtual double getFrequency() const
virtual void setFrequency(double freq)
int stripFileHeader(std::ifstream &file)
virtual void getFieldDimensions(double &zBegin, double &zEnd) const
void checkMap(unsigned int accuracy, std::pair< double, double > fieldDimensions, double deltaZ, const std::vector< double > &fourierCoefficients, gsl_spline *splineCoefficients, gsl_interp_accel *splineAccelerator)
void disableFieldmapWarning()
static std::string typeset_msg(const std::string &msg, const std::string &title)