30 if(!parsing_passed && !file.eof()) {
34 "An error occured when reading the fieldmap '" +
Filename_m +
"'");
78 const double RR2 =
R(0) *
R(0) +
R(1) *
R(1);
86 const double EfieldR = -ezp / 2. + ezppp / 16. * RR2;
88 E(0) += EfieldR *
R(0);
89 E(1) += EfieldR *
R(1);
90 E(2) += ez - ezpp * RR2 / 4.;
119 std::string tmpString;
124 passed = interpretLine<std::string, int>(file, tmpString, tmpInt);
126 passed = interpretLine<std::string, int, std::string>(file, tmpString, tmpInt, tmpString);
129 if (tmpString !=
"TRUE" &&
130 tmpString !=
"FALSE")
132 "The third string on the first line of 1D field "
133 "maps has to be either TRUE or FALSE");
142 std::string tmpString;
146 interpretLine<std::string, int>(file, tmpString, accuracy);
148 interpretLine<std::string, int, std::string>(file, tmpString, accuracy, tmpString);
Inform & endl(Inform &inf)
Inform & level3(Inform &inf)
constexpr double e
The value of.
constexpr double Vpm2MVpm
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)