58 "An error occured when reading the fieldmap '" +
Filename_m +
"'");
105 const double RR2 =
R(0) *
R(0) +
R(1) *
R(1);
107 double ez, ezp, ezpp, ezppp;
115 "The requested interpolation point, " + std::to_string(
R(2)) +
" is out of range");
121 const double EfieldR = -(ezp / 2. + fp * RR2);
124 E(0) += EfieldR *
R(0);
125 E(1) += EfieldR *
R(1);
126 E(2) += ez + 4. * f * RR2;
127 B(0) += -BfieldT *
R(1);
128 B(1) += BfieldT *
R(0);
169 std::string tmpString;
172 interpretLine<std::string, int>(in, tmpString, tmpInt);
173 interpretLine<double, double, int>(in, tmpDouble, tmpDouble, tmpInt);
174 interpretLine<double>(in, tmpDouble);
175 interpretLine<double, double, int>(in, tmpDouble, tmpDouble, tmpInt);
178 F[i].first =
hz_m * i;
179 interpretLine<double>(in, F[i].second);
180 if(
std::abs(F[i].second) > Ez_max) {
187 F[i].second /= Ez_max;
198 std::string tmpString;
203 passed = interpretLine<std::string, int>(file, tmpString, tmpInt);
205 passed = interpretLine<std::string, int, std::string>(file, tmpString, tmpInt, tmpString);
208 if (tmpString !=
"TRUE" &&
209 tmpString !=
"FALSE")
211 "The third string on the first line of 1D field "
212 "maps has to be either TRUE or FALSE");
217 passed = passed && interpretLine<double>(file,
frequency_m);
223 std::string tmpString;
228 interpretLine<std::string, int>(file, tmpString, accuracy);
230 interpretLine<std::string, int, std::string>(file, tmpString, accuracy, tmpString);
233 interpretLine<double>(file, tmpDouble);
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(const PETE_Expr< T > &l)
Inform & endl(Inform &inf)
Inform & level3(Inform &inf)
constexpr double two_pi
The value of.
constexpr double e
The value of.
constexpr double c
The velocity of light in m/s.
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)
bool readFileHeader(std::ifstream &file)
int stripFileHeader(std::ifstream &file)
virtual void getInfo(Inform *)
virtual double getFrequency() const
virtual ~Astra1DDynamic_fast()
virtual bool getFieldstrength(const Vector_t &R, Vector_t &E, Vector_t &B) const
virtual void getFieldDimensions(double &zBegin, double &zEnd) const
virtual void setFrequency(double freq)
virtual bool getFieldDerivative(const Vector_t &R, Vector_t &E, Vector_t &B, const DiffDirection &dir) const
virtual void getOnaxisEz(std::vector< std::pair< double, double > > &F)
Astra1DDynamic_fast(std::string aFilename)
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)
The base class for all OPAL exceptions.