36 "An error occured when reading the fieldmap '" +
Filename_m +
"'");
83 const double RR2 =
R(0) *
R(0) +
R(1) *
R(1);
94 const double EfieldR = -(ezp / 2. + fp * RR2);
97 E(0) += EfieldR *
R(0);
98 E(1) += EfieldR *
R(1);
99 E(2) += ez + 4. * f * RR2;
100 B(0) += -BfieldT *
R(1);
101 B(1) += BfieldT *
R(0);
141 std::string tmpString;
144 interpreteLine<std::string, int>(in, tmpString, tmpInt);
145 interpreteLine<double, double, int>(in, tmpDouble, tmpDouble, tmpInt);
146 interpreteLine<double>(in, tmpDouble);
147 interpreteLine<double, double, int>(in, tmpDouble, tmpDouble, tmpInt);
150 F[i].first =
hz_m * i;
151 interpreteLine<double>(in, F[i].second);
152 if(
fabs(F[i].second) > Ez_max) {
153 Ez_max =
fabs(F[i].second);
159 F[i].second /= Ez_max;
170 std::string tmpString;
175 passed = interpreteLine<std::string, int>(file, tmpString, tmpInt);
177 passed = interpreteLine<std::string, int, std::string>(file, tmpString, tmpInt, tmpString);
180 if (tmpString !=
"TRUE" &&
181 tmpString !=
"FALSE")
183 "The third string on the first line of 1D field "
184 "maps has to be either TRUE or FALSE");
189 passed = passed && interpreteLine<double>(file,
frequency_m);
195 std::string tmpString;
200 interpreteLine<std::string, int>(file, tmpString, accuracy);
202 interpreteLine<std::string, int, std::string>(file, tmpString, accuracy, tmpString);
205 interpreteLine<double>(file, tmpDouble);
virtual void getFieldDimensions(double &zBegin, double &zEnd, double &rBegin, double &rEnd) const
constexpr double e
The value of .
virtual bool getFieldstrength(const Vector_t &R, Vector_t &E, Vector_t &B) const
gsl_spline * onAxisInterpolants_m[4]
PETE_TUTree< FnFabs, typename T::PETE_Expr_t > fabs(const PETE_Expr< T > &l)
constexpr double two_pi
The value of .
std::string toUpper(const std::string &str)
virtual void setFrequency(double freq)
void disableFieldmapWarning()
std::vector< double > getEvenlyDistributedSamplingPoints()
virtual void getInfo(Inform *)
static std::string typeset_msg(const std::string &msg, const std::string &title)
bool determineNumSamplingPoints(std::ifstream &file)
Astra1DDynamic_fast(std::string aFilename)
virtual ~Astra1DDynamic_fast()
std::vector< double > interpolateFieldData(std::vector< double > &samplingPoints)
double readFieldData(std::ifstream &file)
constexpr double c
The velocity of light in m/s.
gsl_interp_accel * onAxisAccel_m[4]
void computeFieldDerivatives(std::vector< double > &fourierComponents, int accuracy)
std::vector< double > computeFourierCoefficients(int accuracy, std::vector< double > &evenSampling)
virtual double getFrequency() const
int stripFileHeader(std::ifstream &file)
bool readFileHeader(std::ifstream &file)
virtual void getOnaxisEz(std::vector< std::pair< double, double > > &F)
virtual bool getFieldDerivative(const Vector_t &R, Vector_t &E, Vector_t &B, const DiffDirection &dir) const
Inform & level3(Inform &inf)
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 normalizeFieldData(double maxEz)
Inform & endl(Inform &inf)