59 "An error occured when reading the fieldmap '" +
Filename_m +
"'");
106 const double RR2 =
R(0) *
R(0) +
R(1) *
R(1);
108 double ez, ezp, ezpp, ezppp;
116 "The requested interpolation point, " + std::to_string(
R(2)) +
" is out of range");
122 const double EfieldR = -(ezp / 2. + fp * RR2);
125 E(0) += EfieldR *
R(0);
126 E(1) += EfieldR *
R(1);
127 E(2) += ez + 4. * f * RR2;
128 B(0) += -BfieldT *
R(1);
129 B(1) += BfieldT *
R(0);
170 std::string tmpString;
173 interpretLine<std::string, int>(in, tmpString, tmpInt);
174 interpretLine<double, double, int>(in, tmpDouble, tmpDouble, tmpInt);
175 interpretLine<double>(in, tmpDouble);
176 interpretLine<double, double, int>(in, tmpDouble, tmpDouble, tmpInt);
179 F[i].first =
hz_m * i;
180 interpretLine<double>(in, F[i].second);
181 if(
std::abs(F[i].second) > Ez_max) {
188 F[i].second /= Ez_max;
199 std::string tmpString;
204 passed = interpretLine<std::string, int>(file, tmpString, tmpInt);
206 passed = interpretLine<std::string, int, std::string>(file, tmpString, tmpInt, tmpString);
209 if (tmpString !=
"TRUE" &&
210 tmpString !=
"FALSE")
212 "The third string on the first line of 1D field "
213 "maps has to be either TRUE or FALSE");
218 passed = passed && interpretLine<double>(file,
frequency_m);
224 std::string tmpString;
229 interpretLine<std::string, int>(file, tmpString, accuracy);
231 interpretLine<std::string, int, std::string>(file, tmpString, accuracy, tmpString);
234 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.
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)
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.