59 "An error occured when reading the fieldmap '" +
Filename_m +
"'");
111 const double RR2 =
R(0) *
R(0) +
R(1) *
R(1);
113 double ez, ezp, ezpp, ezppp;
120 throw OpalException(
"_Astra1DDynamic_fast::getFieldstrength",
121 "The requested interpolation point, " + std::to_string(
R(2)) +
" is out of range");
127 const double EfieldR = -(ezp / 2. + fp * RR2);
130 E(0) += EfieldR *
R(0);
131 E(1) += EfieldR *
R(1);
132 E(2) += ez + 4. * f * RR2;
133 B(0) += -BfieldT *
R(1);
134 B(1) += BfieldT *
R(0);
175 std::string tmpString;
178 interpretLine<std::string, int>(in, tmpString, tmpInt);
179 interpretLine<double, double, int>(in, tmpDouble, tmpDouble, tmpInt);
180 interpretLine<double>(in, tmpDouble);
181 interpretLine<double, double, int>(in, tmpDouble, tmpDouble, tmpInt);
184 F[i].first =
hz_m * i;
185 interpretLine<double>(in, F[i].second);
186 if(
std::abs(F[i].second) > Ez_max) {
193 F[i].second /= Ez_max;
204 std::string tmpString;
209 passed = interpretLine<std::string, int>(file, tmpString, tmpInt);
211 passed = interpretLine<std::string, int, std::string>(file, tmpString, tmpInt, tmpString);
214 if (tmpString !=
"TRUE" &&
215 tmpString !=
"FALSE")
217 "The third string on the first line of 1D field "
218 "maps has to be either TRUE or FALSE");
223 passed = passed && interpretLine<double>(file,
frequency_m);
229 std::string tmpString;
234 interpretLine<std::string, int>(file, tmpString, accuracy);
236 interpretLine<std::string, int, std::string>(file, tmpString, accuracy, tmpString);
239 interpretLine<double>(file, tmpDouble);
virtual bool getFieldDerivative(const Vector_t &R, Vector_t &E, Vector_t &B, const DiffDirection &dir) const
_Astra1DDynamic_fast(const std::string &filename)
constexpr double c
The velocity of light in m/s.
static Astra1DDynamic_fast create(const std::string &filename)
std::shared_ptr< _Astra1DDynamic_fast > Astra1DDynamic_fast
constexpr double two_pi
The value of .
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(const PETE_Expr< T > &l)
virtual void getFieldDimensions(double &zBegin, double &zEnd) const
virtual void setFrequency(double freq)
virtual void getOnaxisEz(std::vector< std::pair< double, double > > &F)
static std::string typeset_msg(const std::string &msg, const std::string &title)
virtual bool getFieldstrength(const Vector_t &R, Vector_t &E, Vector_t &B) const
gsl_spline * onAxisInterpolants_m[4]
std::string toUpper(const std::string &str)
constexpr double Vpm2MVpm
Inform & endl(Inform &inf)
std::vector< double > interpolateFieldData(std::vector< double > &samplingPoints)
void normalizeFieldData(double maxEz)
virtual double getFrequency() const
double readFieldData(std::ifstream &file)
The base class for all OPAL exceptions.
bool readFileHeader(std::ifstream &file)
std::vector< double > getEvenlyDistributedSamplingPoints()
void disableFieldmapWarning()
virtual ~_Astra1DDynamic_fast()
gsl_interp_accel * onAxisAccel_m[4]
int stripFileHeader(std::ifstream &file)
Inform & level3(Inform &inf)
constexpr double e
The value of .
void computeFieldDerivatives(std::vector< double > &fourierComponents, int accuracy)
std::vector< double > computeFourierCoefficients(int accuracy, std::vector< double > &evenSampling)
void checkMap(unsigned int accuracy, std::pair< double, double > fieldDimensions, double deltaZ, const std::vector< double > &fourierCoefficients, gsl_spline *splineCoefficients, gsl_interp_accel *splineAccelerator)
virtual void getInfo(Inform *)
bool determineNumSamplingPoints(std::ifstream &file)