53 if (!parsing_passed) {
57 "Astra1DDynamic_fast::Astra1DDynamic_fast",
58 "An error occured when reading the fieldmap '" +
Filename_m +
"'");
103 const double RR2 = R(0) * R(0) + R(1) * R(1);
105 double ez, ezp, ezpp, ezppp;
113 "Astra1DDynamic_fast::getFieldstrength",
114 "The requested interpolation point, " + std::to_string(R(2)) +
" is out of range");
120 const double EfieldR = -(ezp / 2. + fp * RR2);
123 E(0) += EfieldR * R(0);
124 E(1) += EfieldR * R(1);
125 E(2) += ez + 4. * f * RR2;
126 B(0) += -BfieldT * R(1);
127 B(1) += BfieldT * R(0);
148 double& ,
double& ,
double& ,
double& ,
double& ,
174 std::string tmpString;
183 F[i].first =
hz_m * i;
185 if (std::abs(F[i].second) > Ez_max) {
186 Ez_max = std::abs(F[i].second);
192 F[i].second /= Ez_max;
203 std::string tmpString;
213 if (tmpString !=
"TRUE" && tmpString !=
"FALSE")
215 "Astra1DDynamic_fast::readFileHeader",
216 "The third string on the first line of 1D field "
217 "maps has to be either TRUE or FALSE");
228 std::string tmpString;
ippl::Vector< T, Dim > Vector_t
constexpr double two_pi
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)
Astra1D_fast(std::string aFilename)
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 getFieldDerivative(const Vector_t< double, 3 > &R, Vector_t< double, 3 > &E, Vector_t< double, 3 > &B, const DiffDirection &dir) const
virtual void getFieldDimensions(double &zBegin, double &zEnd) const
virtual void setFrequency(double freq)
virtual void getOnaxisEz(std::vector< std::pair< double, double > > &F)
virtual bool getFieldstrength(const Vector_t< double, 3 > &R, Vector_t< double, 3 > &E, Vector_t< double, 3 > &B) const
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)
bool interpretLine(std::ifstream &in, S &value, const bool &file_length_known=true)
The base class for all OPAL exceptions.